ソースを参照

按shopId获取设备时,统一加上登录状态条件

shizhongqi 6 ヶ月 前
コミット
0e09b52567

+ 1 - 1
biz-ghs/express/classes/GhsDeliveryOrderClass.php

@@ -267,7 +267,7 @@ class GhsDeliveryOrderClass extends BaseClass
             // 发 App 通知
             $title = '发跑腿失败';
             $msg = "批发订单:{$orderId}, 创建跑腿失败:" . $e->getMessage();
-            $allDevices = \bizGhs\device\classes\GhsDeviceClass::getAllByCondition(['shopId' => $shopId]);
+            $allDevices = \bizGhs\device\classes\GhsDeviceClass::getAllByCondition(['shopId' => $shopId, 'status' => 1]);
             $cids = array_column($allDevices, 'clientId');
             $push = new push('ghs', push::MSG_TYPE_WORK);
             $push->pushByCloud($cids, $title, $msg, []);

+ 2 - 2
biz-hd/express/classes/HdDeliveryOrderClass.php

@@ -47,7 +47,7 @@ class HdDeliveryOrderClass extends BaseClass
                 // 发送 app 通知
                 $title = '发跑腿失败';
                 $msg = "零售-缓存数据不存在或已过期,cacheKey:{$cacheKey}";
-                $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId' => $shopId]);
+                $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId' => $shopId, 'status' => 1]);
                 $cids = array_column($allDevices, 'clientId');
                 $push = new push('hd', push::MSG_TYPE_WORK);
                 $push->pushByCloud($cids, $title, $msg, []);
@@ -252,7 +252,7 @@ class HdDeliveryOrderClass extends BaseClass
             // 发 App 通知
             $title = '发跑腿失败';
             $msg = "零售订单:{$orderId}, 创建跑腿失败:" . $e->getMessage();
-            $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId' => $shopId]);
+            $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId' => $shopId, 'status' => 1]);
             $cids = array_column($allDevices, 'clientId');
             $push = new push('hd', push::MSG_TYPE_WORK);
             $push->pushByCloud($cids, $title, $msg, []);

+ 1 - 1
common/components/push.php

@@ -300,7 +300,7 @@ class push
     public function ghsOrderMessage($shop, $cgShop, $order)
     {
         try {
-            $allDevices = \bizGhs\device\classes\GhsDeviceClass::getAllByCondition(['shopId' => $shop->id]);
+            $allDevices = \bizGhs\device\classes\GhsDeviceClass::getAllByCondition(['shopId' => $shop->id, 'status' => 1]);
             $cids = array_column($allDevices, 'clientId');
             $title = '你有新的订单';
 

+ 1 - 1
common/components/rabbitmq/notifyConsumer.php

@@ -151,7 +151,7 @@ class notifyConsumer implements ConsumerInterface
         $cg = PurchaseClass::getById($cgId, true);
         $shopId = $cg->shopId ?? 0;
         $shop = ShopClass::getById($shopId, true);
-        $allDevices = HdDeviceClass::getAllByCondition(['shopId' => $shopId]);
+        $allDevices = HdDeviceClass::getAllByCondition(['shopId' => $shopId, 'status' => 1]);
         $cids = array_column($allDevices, 'clientId');
         $title = '买花成功';
         $shopName = $shop->merchantName . ($shop->shopName != '首店' ? '(' . $shop->shopName . ')' : '');

+ 1 - 1
console/controllers/MqController.php

@@ -97,7 +97,7 @@ class MqController extends Controller
                     $shop = ShopClass::getById($shopId, true);
                     if (!empty($shop)) {
 
-                        $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId'=>$shopId]);
+                        $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId'=>$shopId, 'status' => 1]);
                         $cids = array_column($allDevices, 'clientId');
                         $title = '买花成功';
                         $shopName = $shop->merchantName . ($shop->shopName != '首店' ? '(' . $shop->shopName . ')' : '');