shish 3 년 전
부모
커밋
0f6bc1ebe8
1개의 변경된 파일29개의 추가작업 그리고 5개의 파일을 삭제
  1. 29 5
      biz/shop/classes/ShopExtClass.php

+ 29 - 5
biz/shop/classes/ShopExtClass.php

@@ -22,11 +22,35 @@ class ShopExtClass extends BaseClass
             $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);
+        $hasSh = 0;
+        $hasHs = 0;
+        $workList = WorkClass::getAllByCondition(['orderId' => $order->id], null, '*', null, true);
+        if (!empty($workList)) {
+            foreach ($workList as $work) {
+                if ($work->preNum > $work->num && $work->status == 0) {
+                    $sh = $work->sh ?? 0;
+                    if ($sh == 0) {
+                        $hasHs = 1;
+                    } else {
+                        $hasSh = 1;
+                    }
+                }
+            }
+        }
+        if ($hasHs == 1) {
+            $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);
+        }
+        if ($hasSh == 1) {
+            $lbSn = $shopExt->lbSn ?? '';
+            $lbVersion = $shopExt->lbVersion;
+            $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)