Jelajahi Sumber

修改信息

shish 3 tahun lalu
induk
melakukan
52333e7051
2 mengubah file dengan 28 tambahan dan 0 penghapusan
  1. 13 0
      app-hd/controllers/OrderController.php
  2. 15 0
      biz/shop/classes/ShopExtClass.php

+ 13 - 0
app-hd/controllers/OrderController.php

@@ -51,7 +51,20 @@ class OrderController extends BaseController
         if ($order->status == 5) {
             util::fail('订单已取消');
         }
+        $address = $post['address'] ?? '';
+        $floor = $post['floor'] ?? '';
+        $post['fullAddress'] = $address . $floor;
         OrderClass::updateById($id, $post);
+        $workList = WorkClass::getAllByCondition(['orderId' => $id], null, '*', null, true);
+        if (!empty($workList)) {
+            foreach ($workList as $work) {
+
+            }
+        }
+
+        $shopExt = ShopExtClass::getByCondition(['shopId' => $this->shopId], true);
+        ShopExtClass::orderUpdateRemind($shopExt, $order);
+
         util::complete();
     }
 

+ 15 - 0
biz/shop/classes/ShopExtClass.php

@@ -14,6 +14,21 @@ class ShopExtClass extends BaseClass
 
     public static $baseFile = '\biz\shop\models\ShopExt';
 
+    public static function orderUpdateRemind($shopExt, $order)
+    {
+        $sendNum = $order->sendNum ?? 0;
+        $sound = $sendNum . '号单已被修改';
+        if ($order->fromType == 4) {
+            $mtSn = $order->thirdSn ?? 0;
+            $sound = '美团' . $mtSn . '号单已被修改';
+        }
+        $lbSn = $order->fromType == 4 ? $shopExt->mtLbSn : $shopExt->makeLbSn;
+        $lbVersion = $order->fromType == 4 ? $shopExt->mtLbVersion : $shopExt->makeLbVersion;
+        $url = "https://speaker.17laimai.cn/notify.php?id={$lbSn}&token=HK1626595800&version={$lbVersion}&message=" . $sound;
+        $curl = new curl\Curl();
+        $curl->get($url);
+    }
+
     public static function orderCancelRemind($shopExt, $order)
     {
         $sendNum = $order->sendNum ?? 0;