zory 2 週間 前
コミット
bf0530eb6a

+ 2 - 0
app/controller/mini/Auth.php

@@ -66,6 +66,8 @@ class Auth extends Base
                 "user"      => get_object_vars((new AuthMode)->guard("member")->login($userIn)),
                 "coupon"    => (new SaasOrderLife)->with(['goods' => function($query){
                     $query->field("out_id,product_img");
+                },'store' => function($query){
+                    $query->field("store_id,service_mobile");
                 }])->append(['expire_at'])->withAttr(['expire_at' => function($data,$resp){
                     return date("Y-m-d",strtotime($resp['expire_at']));
                 }])->where("open_id",$openId)->where("status",1)->select()

+ 7 - 1
app/controller/mini/Confirm.php

@@ -34,7 +34,13 @@ class Confirm extends Base
                 "order.require" => "请求参数错误"
             ],'post');
             if (!is_array($param)) return error($param);
-            $order = (new SaasOrderLife)->where("order_id",$param['order'])->where("open_id",$request->user['open_id'])->findOrEmpty();
+            $order = (new SaasOrderLife)->where("order_id",$param['order'])->where("open_id",$request->user['open_id'])->with(['goods' => function($query){
+                $query->field("out_id,product_img");
+            },'store' => function($query){
+                $query->field("store_id,service_mobile");
+            }])->append(['expire_at'])->withAttr(['expire_at' => function($data,$resp){
+                return date("Y-m-d",strtotime($resp['expire_at']));
+            }])->findOrEmpty();
             if ($order->isEmpty()) return error("订单尚未同步");
             $store = (new SaasStore)->where("store_id",$order['store_id'])->where("agent_id",$order['agent_id'])->field("service_mobile,service_type,service_at_start,service_at_end")->findOrEmpty();
             $time = [];

+ 2 - 0
app/controller/mini/Order.php

@@ -61,6 +61,8 @@ class Order extends Base
             }
             $order = (new SaasOrderLife)->where("open_id",$openId)->with(['goods' => function($query){
                 $query->field("out_id,product_img");
+            },'store' => function($query){
+                $query->field("store_id,service_mobile");
             }])->append(['expire_at'])->withAttr(['expire_at' => function($data,$resp){
                 return date("Y-m-d",strtotime($resp['expire_at']));
             }])->findOrEmpty();

+ 2 - 2
app/controller/mini/Test.php

@@ -21,8 +21,8 @@ class Test extends Base
         try {
             $uuid = ["228287898988984"];
 //            $resp = (new \app\extra\douyin\Account())->config($this->getDyConfig())->token()->setWhiteSetting("7513378475235919883",1,true);
-//            $resp = (new Client)->config($this->getDyConfig())->token()->setMiniPath("7513378475235919883");
-            $resp = (new Client)->config($this->getDyConfig())->token()->queryOrder("7513378475235919883","_000SDaHqDYY9GGnyrpYfp4vIPHD8qs32XCx");
+            $resp = (new Client)->config($this->getDyConfig())->token()->setMiniPath("7513378475235919883");
+//            $resp = (new Client)->config($this->getDyConfig())->token()->queryOrder("7513378475235919883","_000SDaHqDYY9GGnyrpYfp4vIPHD8qs32XCx");
             print_r($resp);
             return success("ok");
         } catch (\Throwable $throwable) {

+ 2 - 0
app/extra/basic/Base.php

@@ -49,6 +49,7 @@ class Base
         // 同步已经下单的订单
         if (!empty($account)) {
             $resp = (new Client)->config($this->getDyConfig())->token()->queryOrder($account,$openId);
+            print_r($resp);
             $store = (new SaasStore)->where("store_id",$account)->findOrEmpty();
             if (!empty($resp['data']['orders'])) {
                 $orderData = $orderLog = [];
@@ -68,6 +69,7 @@ class Base
                                 "out_id"        => $certificates['sku_info']['sku_id'],
                                 "product_name"  => $certificates['sku_info']['title'],
                                 "groupon_type"  => $certificates['sku_info']['groupon_type'],
+                                "certificate_id"  => $certificates['certificate_id']??'',
                                 "start_time"    => date("Y-m-d H:i:s",$certificates['start_time']),
                                 "status"        => 1
                             ];

+ 3 - 3
app/extra/douyin/Client.php

@@ -20,15 +20,15 @@ class Client extends Base
             "bind_biz_type"     => 0,
             "path_data_list"    => [
                 [
-                    "path"      => "pages/index/index?account={$account}",
+                    "path"      => "pages/order/detail",
                     "path_type" => 1
                 ],
                 [
-                    "path"      => "pages/index/index?account={$account}",
+                    "path"      => "pages/order/detail",
                     "path_type" => 2
                 ],
                 [
-                    "path"      => "pages/index/index?account={$account}",
+                    "path"      => "pages/order/detail",
                     "path_type" => 3
                 ]
             ]