Răsfoiți Sursa

新订单通知

shish 5 ani în urmă
părinte
comite
5c4cb15036

+ 10 - 0
biz-ghs/order/services/OrderService.php

@@ -15,6 +15,7 @@ use bizGhs\order\classes\OrderClass;
 use bizGhs\order\classes\OrderExpressClass;
 use bizGhs\order\classes\OrderSendClass;
 use bizGhs\stat\classes\StatYjClass;
+use bizGhs\ws\services\WsService;
 use bizHd\purchase\services\PurchaseService;
 use bizHd\stat\classes\StatIncomeClass;
 use bizHd\stat\classes\StatOrderClass;
@@ -511,7 +512,16 @@ class OrderService extends BaseService
         }
 
         if ($isPurchase) {
+            //微信通知新订单
             WxMessageClass::newOrderInform($shop, $order);
+
+            //语音播放新订单
+            $ghsShopAdminIds = \bizGhs\shop\classes\ShopAdminClass::getRemindAdminIdsByShopId($currentShopId);
+            if ($ghsShopAdminIds) {
+                foreach ($ghsShopAdminIds as $v) {
+                    WsService::newOrderNotice($v);
+                }
+            }
         }
 
     }

+ 0 - 10
biz-hd/purchase/services/PurchaseService.php

@@ -316,16 +316,6 @@ class PurchaseService extends BaseService
             WxMessageClass::generateCgOrder($shop, $info);
         }
 
-        //通知供货商语音播放  ghsId =>shopId =>shopAdminIds
-        $ghsShopId = $ghs->shopId;
-        if (!empty($ghsShopId)) {
-            $ghsShopAdminIds = \bizGhs\shop\classes\ShopAdminClass::getRemindAdminIdsByShopId($ghsShopId);
-            if ($ghsShopAdminIds) {
-                foreach ($ghsShopAdminIds as $v) {
-                    WsService::newOrderNotice($v);
-                }
-            }
-        }
     }
 
 }

+ 5 - 5
biz/wx/classes/WxMessageClass.php

@@ -205,7 +205,7 @@ class WxMessageClass extends BaseClass
             return false;
         }
         $orderId = $order->id;
-        $orderSn = $order->orderSn;
+        $orderSn = (string)$order->orderSn;
         $totalFee = $order->actPrice;
         $adminList = ShopAdminClass::getRemainAdmin($shopId);
         foreach ($adminList as $admin) {
@@ -220,17 +220,17 @@ class WxMessageClass extends BaseClass
                 "url" => Yii::$app->params['ghsDomain'],
                 "data" => [
                     "first" => ["value" => '亲,您的采购单已生成', "color" => "#173177"],
-                    "keyword1" => ["value" => (string)$orderSn, "color" => "#173177"],
-                    "keyword2" => ["value" => '-', "color" => "#173177"],
+                    "keyword1" => ["value" => $orderSn, "color" => "#173177"],
+                    "keyword2" => ["value" => '花材', "color" => "#173177"],
                     "keyword3" => ["value" => $order->bigNum . '/' . $order->smallNum, "color" => "#173177"],
                     "keyword4" => ["value" => number_format($totalFee, 2) . '元', "color" => "#173177"],
-                    "keyword5" => ["value" => '微信支付', "color" => "#173177"],
+                    "keyword5" => ["value" => '-', "color" => "#173177"],
                     "remark" => ["value" => "", "color" => "#173177"]
                 ]
             ];
 
             $data['miniprogram']['appid'] = $wx['miniAppId'];
-            $data['miniprogram']['pagepath'] = 'pagesPurchase/shopping?id=' . $orderId;
+            $data['miniprogram']['pagepath'] = 'pagesPurchase/purDetails?id=' . $orderId;
 
             wxUtil::sendTaskInform($data, $wx, $ptStyle);
         }