|
|
@@ -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;
|
|
|
}
|