zory преди 1 седмица
родител
ревизия
5e7664fa06

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

@@ -82,7 +82,7 @@ class Confirm extends Base
             $param['agent_id'] = $orderLife['agent_id'];
             $param['product_id'] = $orderLife['out_id'];
             $param['product_name'] = $orderLife['product_name'];
-            $param['status'] = 2;
+            $param['status'] = 1;
             $param['username'] = $address['username']??'';
             $param['mobile'] = $address['mobile']??'';
             $param['region'] = $address['region']??'';

+ 4 - 1
app/controller/mini/Order.php

@@ -157,6 +157,8 @@ class Order extends Base
                 $query->field("out_id,product_name,product_img,product_price");
             },'poi' => function ($query) {
                 $query->field("poi_id,poi_name,poi_address");
+            },'parent' => function($query){
+                $query->field("order_id,pay_amount,expire_at,order_amount");
             }])->findOrEmpty();
             if ($order->isEmpty()) return error("订单数据异常");
             if ($order['open_id'] <> $request->user['open_id']) return error("订单数据异常");
@@ -177,7 +179,8 @@ class Order extends Base
     {
         try {
             $param = $this->_valid([
-                "order.require"  => "参数错误"
+                "order.require"  => "参数错误",
+                "type.default"   => 1 // 1无需审核 2需要审核
             ],"post");
             if (!is_array($param)) return error($param);
             $order = (new SaasOrder)->where("order_sn",$param['order'])->with(['goods' => function($query){

+ 3 - 1
app/controller/mini/Test.php

@@ -20,7 +20,9 @@ class Test extends Base
     {
         try {
             $uuid = ["228287898988984"];
-            $resp = (new \app\extra\douyin\Account())->config($this->getDyConfig())->token()->setWhiteSetting("7513378475235919883",1,false,$uuid);
+//            $resp = (new \app\extra\douyin\Order())->config($this->getDyConfig())->token()->getOrderDetail(["1090054060293461518"]);
+            $resp = (new \app\extra\douyin\Order())->config($this->getDyConfig())->token()->orderLock(1,"1090054060293461518","7578130844109078591","76IQA12W5EQ8NKELH8");
+//            $resp = (new \app\extra\douyin\Account())->config($this->getDyConfig())->token()->setWhiteSetting("7513378475235919883",1,false,$uuid);
 //            $resp = (new Client)->config($this->getDyConfig())->token()->setMiniPath("7513378475235919883");
 //            $resp = (new Client)->config($this->getDyConfig())->token()->queryOrder("7513378475235919883","_000SDaHqDYY9GGnyrpYfp4vIPHD8qs32XCx");
             print_r($resp);

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

@@ -49,7 +49,6 @@ 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 = [];

+ 4 - 0
app/extra/douyin/Client.php

@@ -48,6 +48,10 @@ class Client extends Base
             "account_id"        => $account,
             "open_id"           => $openId,
             "biz_type"          => 1,
+            "time_range"        => [
+                "start_time" => strtotime("-120 min"),
+                "end_time"  => strtotime("+120 min")
+            ]
         ];
         return Http::asJson()->withHeaders($this->header)->post($this->gateway."api/trade/v2/fulfillment/query_user_certificates/", $param)->array();
     }

+ 7 - 1
app/extra/douyin/Order.php

@@ -8,7 +8,13 @@ use yzh52521\EasyHttp\Http;
 class Order extends Base
 {
 
-    public function getOrderDetail(array $orderList = [])
+
+    /**
+     * 订单详情
+     * @param array $orderList
+     * @return array
+     */
+    public function getOrderDetail(array $orderList = []): array
     {
         $param = [
             "order_id_list" => $orderList,

+ 5 - 0
app/model/saas/SaasOrder.php

@@ -68,5 +68,10 @@ class SaasOrder extends Model
         return $this->hasOne("app\model\saas\SaasStoreShop",'poi_id','poi_id');
     }
 
+    public function parent(): HasOne
+    {
+        return $this->hasOne("app\model\saas\SaasOrderLife",'order_id','order_id');
+    }
+
 
 }