[ [ "id"=>20100, "name"=>"百货" ], [ "id"=>20200, "name"=>"母婴" ], [ "id"=>20300, "name"=>"食品" ], [ "id"=>20400, "name"=>"女装" ], [ "id"=>20500, "name"=>"电器" ], [ "id"=>20600, "name"=>"鞋包" ], [ "id"=>20700, "name"=>"内衣" ], [ "id"=>20800, "name"=>"美妆" ], [ "id"=>20900, "name"=>"男装" ], [ "id"=>21000, "name"=>"水果" ], [ "id"=>21100, "name"=>"家纺" ], [ "id"=>21200, "name"=>"文具" ], [ "id"=>21300, "name"=>"运动" ], [ "id"=>21400, "name"=>"虚拟" ], [ "id"=>21500, "name"=>"汽车" ], [ "id"=>21600, "name"=>"家装" ], [ "id"=>21700, "name"=>"家具" ], [ "id"=>21800, "name"=>"医药" ], ], "activity"=>[ [ "id"=>4, "name"=>"秒杀" ], [ "id"=>7, "name"=>"百亿补贴" ], [ "id"=>10851, "name"=>"千万补贴" ], [ "id"=>10913, "name"=>"招商礼金商品" ], [ "id"=>31, "name"=>"品牌黑标" ], [ "id"=>10564, "name"=>"精选爆品-官方直推爆款" ], [ "id"=>10584, "name"=>"精选爆品-团长推荐" ], [ "id"=>24, "name"=>"品牌高佣" ], ], "channel"=>[ [ "id"=>1, "name"=>"今日销量榜" ], [ "id"=>3, "name"=>"相似商品推荐" ], [ "id"=>4, "name"=>"猜你喜欢" ], [ "id"=>5, "name"=>"实时热销榜" ], [ "id"=>6, "name"=>"实时收益榜" ] ] ]; } /** * 商品列表逻辑 */ public static function getGoodsListLogic() { $params = request()->all(); $userId = BaseUtil::getUserId(); $platformSid = BaseUtil::getPlatformUserSpreadId(PlatformTypeEnum::PLATFORM_PINGDUODUO,$userId); $beanData = [ "pid"=>$platformSid, "offset"=>($params["page"]-1)*20 ]; //判断活动 if(isset($params["activity_id"])){ $beanData["activity_tags"] = json_encode([ $params["activity_id"] ]); } //判断类目 if(isset($params["cate_id"])){ $beanData["cate_id"] = $params["cate_id"]; } //判断频道 if(isset($params["channel_id"])){ $beanData["channel_type"] = $params["channel_type"]; } $bean = new GoodsRecommendGetParamBean($beanData); $goods = DuoDuoKeUtil::goodsRecommendGet($bean); $datas = $goods["goods_basic_detail_response"]["list"]; return [ "total"=>$goods["goods_basic_detail_response"]["total"], "list"=>$datas ]; } /** * 商品推广链接逻辑 */ public static function getGoodsRecommendUrlLogic() { $params = request()->all(); $userId = BaseUtil::getUserId(); $platformSid = BaseUtil::getPlatformUserSpreadId(PlatformTypeEnum::PLATFORM_PINGDUODUO,$userId); //1.判断推广位是否备案 $oauthRes = DuoDuoKeUtil::memberAuthorityQuery($platformSid); //2.未备案这授权,已备案则直接获取推广链接 $beanData = [ "p_id"=>$platformSid, "goods_sign_list"=>json_encode([$params["goods_sign"]]), ]; if($oauthRes["authority_query_response"]["bind"]){ //已备案 }else{ //未备案 $beanData["generate_authority_url"] = "true"; } $generateBean = new GoodsPromotionUrlGenerateParamBean($beanData); $res = DuoDuoKeUtil::goodsPromotionUrlGenerate($generateBean); return [ "link_url"=>$res["goods_promotion_url_generate_response"]["goods_promotion_url_list"][0]["mobile_short_url"] ]; } }