mark 1 năm trước cách đây
mục cha
commit
a855d60b63

+ 19 - 0
app/Http/Controllers/BaseController.php

@@ -30,6 +30,7 @@ use App\Models\TaobaoPidModel;
 use App\Models\UserOrderCommissionModel;
 use App\Models\WechatAccountModel;
 use EasyWeChat\Kernel\Messages\Image;
+use ETaobao\Factory;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\DB;
 use Tool\ShanTaoTool\Bean\Pdd\Ddk\ResourceUrlGenParamBean;
@@ -134,6 +135,24 @@ class BaseController extends Controller
 
     public function test()
     {
+        $config = [
+            "appkey"=>"25324796",//淘宝客appKey
+            "secretKey"=>"a74d58d18912f7c49acac39fdb7b4af5",//secretKey
+            "format"=>"json",//返回的数据格式
+            "session"=>"",//授权接口(sc类的接口)需要带上
+            "sandbox"=>false,
+        ];
+        $app = Factory::tbk($config);
+
+        $params = [
+            "adzone_id"=>"70362850341",
+            "q"=>"空调"
+        ];
+        $res = $app->tpwd->httpPost("taobao.tbk.dg.material.optional",$params);
+        return $this->success($res);
+        
+        $datas = JutuikeUtil::getActList();
+        dd($datas);
         $res = JingDongUtil::getGoodsListByCategory(652,1);
         dd($res);
         dd(TaobaoLianMengUtil::getActivityInfo(70362850341,"20150318020002597"));

+ 2 - 1
app/Http/Utils/TaoBao/TaobaoLianMengUtil.php

@@ -33,6 +33,7 @@ class TaobaoLianMengUtil extends BaseUtil
      */
     public static function getActivityInfo($adzone_id,$activity_material_id)
     {
+        $instance = new LoggerFactoryUtil(TaobaoLianMengUtil::class);
         //根据pid找到淘宝信息
         $taobao = TaobaoPidModel::query()
             ->where("adzone_id",$adzone_id)
@@ -51,7 +52,7 @@ class TaobaoLianMengUtil extends BaseUtil
             "activity_material_id"=>$activity_material_id
         ];
         $res = $app->content->getActivityInfo($params);
-
+        $instance->info("淘宝返回数据:".$res);
         $res = json_decode(json_encode($res),true);
         if(isset($res["code"])){
             throw new TaobaoException($res["sub_msg"]);