diff --git a/app/api/controller/Home/Home.php b/app/api/controller/Home/Home.php new file mode 100644 index 0000000..f4c6e93 --- /dev/null +++ b/app/api/controller/Home/Home.php @@ -0,0 +1,63 @@ +param(); + $con = []; + + $loveStoryList = ModelLoveStory::where($con) + ->field([ + 'love_story_id', + 'love_story_title', + 'love_story_author', + 'love_story_place', + 'love_story_date', + 'love_story_cover', + ]) + ->order('love_story_sort', 'asc') + ->limit(4) + ->select(); + + + $wishList = ModelWishList::where($con) + ->field([ + 'wish_list_id', + 'wish_list_name', + 'wish_list_author', + 'wish_list_status', + 'wish_list_create_time', + 'wish_list_sort' + ]) + ->order('wish_list_sort', 'desc') + ->limit(3) + ->select(); + + return msg(0, "获取心愿单列表成功!", [ + 'data' => [ + 'wishList' => $wishList, + 'loveStoryList' => $loveStoryList + ] + ]); + } +}