代码提交
This commit is contained in:
@@ -168,12 +168,12 @@ class Adapter implements WeChatServiceInterface
|
||||
$task_id = $task['task_id'];
|
||||
|
||||
$task_info = $this->getCustomerAcquisitionTask($task_id);
|
||||
|
||||
if (empty($task_info['status']) || empty($task_info['reqConf']) || empty($task_info['reqConf']['device'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$wechatIdAccountIdMap = $this->getWeChatIdsAccountIdsMapByDeviceIds($task_info['reqConf']['device']);
|
||||
|
||||
if (empty($wechatIdAccountIdMap)) {
|
||||
continue;
|
||||
}
|
||||
@@ -183,10 +183,11 @@ class Adapter implements WeChatServiceInterface
|
||||
|
||||
// 是否已经是好友的判断,如果已经是好友,直接break; 但状态还是维持1,让另外一个进程处理发消息的逻辑
|
||||
$isFriend = $this->checkIfIsWeChatFriendByPhone($wechatId, $task['phone']);
|
||||
// if ($isFriend) {
|
||||
// $task['processed_wechat_ids'] = $task['processed_wechat_ids'] . ',' . $wechatId; // 处理失败任务用,用于过滤已处理的微信号
|
||||
// break;
|
||||
// }
|
||||
if ($isFriend) {
|
||||
$friendAddTaskCreated = true;
|
||||
$task['processed_wechat_ids'] = $task['processed_wechat_ids'] . ',' . $wechatId; // 处理失败任务用,用于过滤已处理的微信号
|
||||
break;
|
||||
}
|
||||
|
||||
// 判断时间间隔\时间段和最后一次的状态
|
||||
$canCreateFriendAddTask = $this->checkIfCanCreateFriendAddTask($wechatId, $task_info['reqConf']);
|
||||
@@ -218,7 +219,7 @@ class Adapter implements WeChatServiceInterface
|
||||
->where('id', $task['id'])
|
||||
->update([
|
||||
'status' => $friendAddTaskCreated ? 1 : 3,
|
||||
'fail_reason' => $friendAddTaskCreated ? '' : '所有账号不可添加',
|
||||
'fail_reason' => $friendAddTaskCreated ? '' : '已经是好友了',
|
||||
'processed_wechat_ids' => $task['processed_wechat_ids'],
|
||||
'updated_at' => time()
|
||||
]); // ~~不用管,回头再添加再判断即可~~
|
||||
@@ -441,7 +442,7 @@ class Adapter implements WeChatServiceInterface
|
||||
$task_info['msgConf'] = json_decode($task_info['msgConf'], true);
|
||||
$task_info['tagConf'] = json_decode($task_info['tagConf'], true);
|
||||
Cache::set('task_info_' . $id, $task_info, 600);
|
||||
|
||||
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user