林琦海 5 лет назад
Родитель
Сommit
19a5ee28ea
2 измененных файлов с 20 добавлено и 1 удалено
  1. 17 0
      biz-hd/purchase/services/PurchaseService.php
  2. 3 1
      biz/ghs/classes/GhsClass.php

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

@@ -10,6 +10,8 @@ use biz\shop\models\Shop;
 use bizGhs\custom\classes\CustomClass;
 use bizGhs\order\classes\OrderClass;
 use bizGhs\order\services\OrderService;
+use bizGhs\ws\services\WsService;
+use bizHd\admin\classes\ShopAdminClass;
 use bizHd\base\services\BaseService;
 use bizHd\purchase\classes\PurchaseClass;
 use common\components\dict;
@@ -268,6 +270,21 @@ class PurchaseService extends BaseService
         $ghs->expendAmount = bcadd($ghs->expendAmount, $actPrice, 2);
         $ghs->expendNum += 1;
         $ghs->save();
+
+        //通知供货商语音播放  ghsId =>shopId =>shopAdminIds
+        $ghsInfo = GhsClass::getById($ghsId);
+        if($ghsInfo){
+            $ghsShopId = $ghsInfo['shopId'];
+            if($ghsShopId){
+                $ghsShopAdminIds = \bizGhs\shop\classes\ShopAdminClass::getRemindAdminIdsByShopId($ghsShopId);
+                if($ghsShopAdminIds){
+                    foreach ($ghsShopAdminIds as $v){
+                        WsService::newOrderNotice($v);
+                    }
+                }
+            }
+        }
+
     }
 
 }

+ 3 - 1
biz/ghs/classes/GhsClass.php

@@ -172,8 +172,10 @@ class GhsClass extends BaseClass
     public static function formatGhsInfo($ghs)
     {
         return [
-            'id' => $id,
+
         ];
     }
 
+    
+
 }