services = $services; } /** * 获取礼包商品列表(最外层礼包名列表) * @return \think\Response * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException * @author wuhaotian * @email 442384644@qq.com * @date 2024/12/17 */ public function getGiftProductList() { $where = $this->request->getMore([ ['name', ''] ]); return app('json')->success($this->services->getGiftProductList($where)); } /** * 获取推荐关系列表 * - 只传product_id:显示该商品中最上层的推荐人(只存在于pid中,而没有在uid里的用户) * - 同时传product_id和uid:显示该用户的小组成员(fake_pid为该uid的用户) * @return \think\Response */ public function getRecommendationRelationList() { $where = $this->request->getMore([ ['product_id', 0], ['uid', 0] ]); return app('json')->success($this->services->getRecommendationRelationList($where)); } /** * 获取指定商品的所有推荐关系用户 * @return \think\Response */ public function getRecommendationUsers() { $product_id = $this->request->get('product_id', 0); if (!$product_id) return app('json')->fail('请选择商品'); $users = $this->services->getRecommendationUsers($product_id); return app('json')->success($users); } }