dongxiaoqin пре 11 месеци
родитељ
комит
9200f95c9d

+ 14 - 1
app/adminapi/service/WeCallService.php

@@ -30,6 +30,7 @@ class WeCallService
     protected $appKey;
     protected $appSecret;
     protected $taskId;
+    protected $autoTaskId = 2540553;
     protected $status = 0;
 
     public function __construct()
@@ -38,7 +39,12 @@ class WeCallService
         if ($config) {
             $this->appKey = isset($config['appKey']) ? $config['appKey'] : '';
             $this->appSecret = isset($config['appSecret']) ? $config['appSecret'] : '';
-            $this->taskId = isset($config['taskId']) ? $config['taskId'] : '';
+            //09-20点,使用自动外呼任务
+            if (date("H") >= 9 && date("H") < 20) {
+                $this->taskId = $this->autoTaskId;//自动外呼任务
+            } else {
+                $this->taskId = isset($config['taskId']) ? $config['taskId'] : '';
+            }
             $this->status = isset($config['status']) ? $config['status'] : 0;
         } 
     }
@@ -97,6 +103,9 @@ class WeCallService
      * 开启外呼任务(仅手动任务可调用)
      */
     public function startTask(){
+        if ($this->taskId == $this->autoTaskId) {
+            return ['code' => 200];
+        }
         if ($this->status == 0) {
             return false;
         }
@@ -123,6 +132,10 @@ class WeCallService
      * 停止外呼任务(仅手动任务可调用)
      */
     public function stopTask(){
+        if ($this->taskId == $this->autoTaskId) {
+            return ['code' => 200];
+        }
+
         if ($this->status == 0) {
             return false;
         }

+ 2 - 2
app/common/command/AutomaticDispatch.php

@@ -155,9 +155,9 @@ class AutomaticDispatch extends Command
     protected function startTask() {
         if ($this->customerList) {
             $weCallService = new WeCallService();
-            $res = $weCallService->startTask();
+            $res = $weCallService->importUser($this->customerList);
             if (isset($res['code']) && $res['code'] == 200) {
-                $res = $weCallService->importUser($this->customerList);
+                $res = $weCallService->startTask();
             }
         }
         $this->customerList = [];

+ 0 - 3
app/common/command/FaultInit.php

@@ -34,9 +34,6 @@ class FaultInit extends Command
         //空调加氟(变频挂机 1-1.5P加氟)
         $this->getData('23153',1,52);
 
-        //空调加氟(变频挂机 1-1.5P加氟)
-        $this->getData('23153',1,52);
-
         //空调加氟(变频挂机 2-3P加氟)
         $this->getData('23154',1,52);