林琦海 %!s(int64=5) %!d(string=hai) anos
pai
achega
0f00a125af
Modificáronse 1 ficheiros con 14 adicións e 1 borrados
  1. 14 1
      biz-ghs/ws/services/WsService.php

+ 14 - 1
biz-ghs/ws/services/WsService.php

@@ -22,5 +22,18 @@ class WsService
 
     //零售端采购时,提示供货商(下所有有开启通知的员工),你有新订单
     //商城客户下单时,提示零售花店(下所有有开启通知的员工) 你有新的订单
-    //todo
+    public static function newOrderNotice($shopAdminId)
+    {
+        $url = 'https://img.theflorist.cn/audio/new_order0.mp3';
+        $data = [
+            'type'=>'new_order',
+            'url'=>$url,
+        ];
+        try{
+            Gateway::sendToUid($shopAdminId, json_encode($data));
+        }catch (\Exception $exception){
+            Yii::warning("ws arrivalNotice error ". $exception->getMessage());
+        }
+        return true;
+    }
 }