Przeglądaj źródła

新订单通知

shish 3 lat temu
rodzic
commit
66b4f73a3e
1 zmienionych plików z 8 dodań i 6 usunięć
  1. 8 6
      app-ghs/controllers/OrderController.php

+ 8 - 6
app-ghs/controllers/OrderController.php

@@ -1270,12 +1270,14 @@ class OrderController extends BaseController
         if (!empty($order)) {
             $shopId = $order->shopId ?? 0;
             $shop = ShopClass::getById($shopId, true);
-            if (!empty($shop)) {
-                //花店采购供货商端微信收到通知
-                //WxMessageClass::ghsHasNewOrderInform($shop, $order);
-                $noticeText = json_encode(['orderId' => $id]);
-                $noticeKey = "hdCgNoticeGhs";
-                Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
+            if (isset($order->payStatus) && $order->payStatus == 1) {
+                if (!empty($shop)) {
+                    //花店采购供货商端微信收到通知
+                    //WxMessageClass::ghsHasNewOrderInform($shop, $order);
+                    $noticeText = json_encode(['orderId' => $id]);
+                    $noticeKey = "hdCgNoticeGhs";
+                    Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
+                }
             }
             //订单生成时唤起在线打印
             if (isset($order->needPrint) && $order->needPrint == dict::getDict('needPrint', 'need')) {