Browse Source

fix:过滤条件为sub-all的按全量用户标签推;

Wang Chen 3 năm trước cách đây
mục cha
commit
74ef6188f9
2 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 5 0
      app/Consts/PushConst.php
  2. 2 1
      app/Modules/Push/Services/PushService.php

+ 5 - 0
app/Consts/PushConst.php

@@ -27,6 +27,11 @@ class PushConst
     const FILTER_ALL_USERS = 'all';
 
     /**
+     * 全量用户
+     */
+    const FILTER_ALL_SUB_USERS = 'sub-all';
+
+    /**
      * 华为服务商
      */
     const PROVIDER_HW = 'huawei';

+ 2 - 1
app/Modules/Push/Services/PushService.php

@@ -150,7 +150,8 @@ class PushService
         QappPushTask::updateMainTaskStatus($taskId, PushConst::STATUS_DOING, '无有效推送APP');
 
         // 全量发送走标签,否则走批量
-        if (getProp($pushTask, 'push_filter') === PushConst::FILTER_ALL_USERS) {
+        $pushFilter = getProp($pushTask, 'push_filter');
+        if (in_array($pushFilter, [PushConst::FILTER_ALL_USERS, PushConst::FILTER_ALL_SUB_USERS])) {
             $result = self::pushMessageToAll($pushTask, $subTasks, $pushApps);
         } else {
             $result = self::pushMessageToUsers($pushTask, $subTasks, $pushApps);