zory 1 viikko sitten
vanhempi
sitoutus
5b9325a7de
2 muutettua tiedostoa jossa 9 lisäystä ja 0 poistoa
  1. 5 0
      app/controller/merchant/Order.php
  2. 4 0
      app/controller/mini/Confirm.php

+ 5 - 0
app/controller/merchant/Order.php

@@ -252,6 +252,11 @@ class Order extends Base
             if (!is_array($param)) return error($param);
             $order = $this->mode->where("order_sn",$param['order'])->findOrEmpty();
             if ($order->isEmpty()) return error("订单数据异常");
+            $dyConfig = sConf("dy.");
+            $endStart = strtotime(date("Y-m-d ".$dyConfig['express_start'].":00"));
+            $endEnd = strtotime(date("Y-m-d ".$dyConfig['express_end'].":00"));
+            if (time() < $endStart) return error("为确保店铺安全,该时间内系统暂停呼叫快递功能!");
+            if (time() > $endEnd) return error("为确保店铺安全,该时间内系统暂停呼叫快递功能~");
             return errorTrans("error.data");
         } catch (\Throwable $throwable) {
             return error($throwable->getMessage());

+ 4 - 0
app/controller/mini/Confirm.php

@@ -90,6 +90,8 @@ class Confirm extends Base
             $param['address'] = $address['address']??'';
             if (empty($orderLife['certificate_id'])) {
                 $orderDetail = (new DouyinOrder)->config($this->getDyConfig())->token()->getOrderDetail([$param['order']]);
+                echo getDateFull()."===获取券码返回\n";
+                print_r($orderDetail);
                 if (!isset($orderDetail['data']['certificate_info_list'][0]['certificate_id'])) return error("订单数据异常!");
                 $param['certificate_id'] = $orderDetail['data']['certificate_info_list'][0]['certificate_id'];
             } else {
@@ -98,6 +100,8 @@ class Confirm extends Base
             $param['lock_key'] = strtoupper(CodeExtend::random(18,3));
             // 锁码
             $resp = (new DouyinOrder)->config($this->getDyConfig())->token()->orderLock(2,$param['order'],$param['certificate_id'],$param['lock_key']);
+            echo getDateFull()."===锁码返回\n";
+            print_r($resp);
             if ($resp['err_no'] <> 0) return error("订单数据异常");
             $orderLife->status = 2;
             $orderLife->save();