mark il y a 3 ans
Parent
commit
fc5ad39378

+ 21 - 20
app/Http/Controllers/BaseController.php

@@ -128,24 +128,24 @@ class BaseController extends Controller
 
     public function test()
     {
-        $data = JutuikeUtil::goodsCategory("jd");
-        return $this->success($data);
+//        $data = JutuikeUtil::goodsCategory("jd");
+//        return $this->success($data);
 //        $url = "https://mobile.yangkeduo.com/goods.html?_wvx=10&refer_share_uin=RKJBZMVHVOZWU3HQPZYUD5MAEQ_GEXDA&refer_share_uid=5985443220&share_uin=RKJBZMVHVOZWU3HQPZYUD5MAEQ_GEXDA&page_from=23&_wv=41729&refer_share_id=vJXEDkANGEc4uvPW9QgRCHPj3P6GELOc&refer_share_channel=copy_link&share_uid=5985443220&pxq_secret_key=EUEHP3OMNH3X4GQUAL37HDD7UJBLLM3OD42X55VHLGG6GT3EBPLQ&goods_id=276748200008";
-        $url = "https://mobile.yangkeduo.com/goods.html?_wvx=10&refer_share_uin=QKZTKYYF4LYNCB7SVBSL42IYWY_GEXDA&refer_share_uid=3669222324&share_uin=QKZTKYYF4LYNCB7SVBSL42IYWY_GEXDA&page_from=101&_wv=41729&refer_share_id=l6x0HEi8EMpQ2F9CJiCmsW1IqO5fnT3K&refer_share_channel=copy_link&share_uid=3669222324&pxq_secret_key=6T5MOY4WIDK2ALUXMKACS7QZ3CEYWBUQRZATVA5T5PDULJS3CV6A&goods_id=169921843493";
+//        $url = "https://mobile.yangkeduo.com/goods.html?_wvx=10&refer_share_uin=QKZTKYYF4LYNCB7SVBSL42IYWY_GEXDA&refer_share_uid=3669222324&share_uin=QKZTKYYF4LYNCB7SVBSL42IYWY_GEXDA&page_from=101&_wv=41729&refer_share_id=l6x0HEi8EMpQ2F9CJiCmsW1IqO5fnT3K&refer_share_channel=copy_link&share_uid=3669222324&pxq_secret_key=6T5MOY4WIDK2ALUXMKACS7QZ3CEYWBUQRZATVA5T5PDULJS3CV6A&goods_id=169921843493";
 
 //        $tmp = BaseUtil::getParamsByUrl($url);
 
 //        $url = $tmp["url"]."?goods_id=".$tmp["goods_id"];
         //获取商品详情
-        $bean = new GoodsSearchParamBean(
-            [
-                "keyword"=>$url,
-                "pid"=>"23985775_220421267"
-            ]
-        );
-        dump($url);
-        $goodsData = DuoDuoKeUtil::goodsSearch($bean);
-        dd($goodsData);
+//        $bean = new GoodsSearchParamBean(
+//            [
+//                "keyword"=>$url,
+//                "pid"=>"23985775_220421267"
+//            ]
+//        );
+//        dump($url);
+//        $goodsData = DuoDuoKeUtil::goodsSearch($bean);
+//        dd($goodsData);
 //
 //        $url = "https://mobile.yangkeduo.com/goods.html?goods_id=276748200008";
 //        $data = DuoDuoKeUtil::goodsZsUnitUrlGen("23985775_220421267",$url);
@@ -157,8 +157,8 @@ class BaseController extends Controller
 //        $app = WechatAccountUtil::getApp("fanbuting");
 //        $result = $app->material->uploadImage("1.png");
 //        dd($result);
-        $data = JutuikeUtil::getActList();
-        return $this->success($data);
+//        $data = JutuikeUtil::getActList();
+//        return $this->success($data);
 //        $url = "0.0₤R9nsXr6r5tH₴ https://m.tb.cn/h.fWKqJYQ?sm=9652d6  2-5条 收小肚子中高腰内裤女裆收腹提臀束腰塑身三角裤";
 //
 //        $res = preg_match("/https\:\/\/m\.tb\.cn/",$url,$match);
@@ -166,15 +166,16 @@ class BaseController extends Controller
 //        dd($match);
 //        $url = "https://m.vip.com/product-1710619050-6919460940636579082.html?nmsns=shop_iphone-7.54.6-link&nst=product&nsbc=&nct=link&ncid=e65103bd61351bb17486b16b4492127425d68046&nabtid=13&nuid=&nchl_param=share:e65103bd61351bb17486b16b4492127425d68046:1632980761329&mars_cid_a=e65103bd61351bb17486b16b4492127425d68046&chl_type=share";
 //        $res = preg_match("/https\:\/\/m\.vip\.com/",$url,$match);
-        $url = "https://item.m.jd.com/product/13441798.html?&utm_source=iosapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL&ad_od=share";
+//        $url = "https://item.m.jd.com/product/13441798.html?&utm_source=iosapp&utm_medium=appshare&utm_campaign=t_335139774&utm_term=CopyURL&ad_od=share";
 //        $url = "2👈啊brXxXrh98ep哈 https://m.tb.cn/h.fWqjHlK?sm=4fbca7  心相印纸巾茶语丝享抽纸家用实惠装餐巾纸面巾纸心心相印纸巾6包";
 //        $url = "https://m-goods.kaola.com/product/1383664.html?shareOs=iOS&datid=__da_230bb323_5691a97408c33c80&klasspm=a215sy.page_kla_productpage.growthshare.copylink";
-        dump($url);
+//        dump($url);
+        $url = "https://m.tb.cn/h.f6WeDYQ?sm=978306 ";
         $goods = JutuikeUtil::transferGoodsLink($url);
-//        dump($goods);
-        dump($goods["data"]["goodsId"]);
-        $data = JutuikeUtil::convert($goods["data"]["goodsId"],"jtkupstream21","jd");
-//        dd($data);
+        dump($goods);
+        dump($goods["goodsId"]);
+        $data = JutuikeUtil::convert($goods["goodsId"],"jtkupstream21");
+        dd($data);
 //        return $this->success($data);
 //        $oauthRes = DuoDuoKeUtil::memberAuthorityQuery("23985775_220421267");
 //        if(!$oauthRes["authority_query_response"]["bind"]){

+ 6 - 0
app/Http/Controllers/Buy/BuyController.php

@@ -204,6 +204,12 @@ class BuyController extends BaseController
      *          type="string"
      *     ),
      *     @SWG\Parameter(
+     *          name="sort",
+     *          in="query",
+     *          description="1-综合排序,2-价格升序,3-销量降序 默认1",
+     *          type="string"
+     *     ),
+     *     @SWG\Parameter(
      *          name="source",
      *          in="query",
      *          description="来源 jd-京东,vip-唯品会,pdd-拼多多,kaola-考拉,taobao-淘宝",

+ 6 - 0
app/Http/Logic/Buy/BuyLogic.php

@@ -56,6 +56,7 @@ class BuyLogic extends BaseLogic
         $datas = [];
         foreach ($lists["list"] as $list){
             $datas[] = [
+                "shop_name"=>$list["shopName"]??"",
                 "goods_name"=>$list["goodsName"],
                 "goods_thumb_url"=>$list["goodsThumbUrl"],
                 "market_price"=>$list["marketPrice"],
@@ -123,6 +124,10 @@ class BuyLogic extends BaseLogic
             "page"=>$params["page"],
             "pageSize"=>$params["page_size"],
         ];
+
+        if(isset($params["sort"])){
+            $arr["sort"] = $params["sort"];
+        }
         $bean = new GoodsSearchParamBean($arr);
         $res = JutuikeUtil::goodsSearch($bean);
 
@@ -130,6 +135,7 @@ class BuyLogic extends BaseLogic
 
         foreach ($res["list"] as $list){
             $datas[] = [
+                "shop_name"=>$list["shopName"]??"",
                 "goods_name"=>$list["goodsName"],
                 "goods_thumb_url"=>$list["goodsThumbUrl"],
                 "market_price"=>$list["marketPrice"],