diff --git a/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php b/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php index b0f38ef4..2a8914f8 100644 --- a/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php +++ b/Server/extend/WeChatDeviceApi/Adapters/ChuKeBao/Adapter.php @@ -247,8 +247,10 @@ class Adapter implements WeChatServiceInterface { $tasks = Db::name('task_customer') - ->whereIn('status', [1,2,3]) + ->whereIn('status', [1,2]) + ->where('updated_at', '>=', (time() - 86400 * 3)) ->limit(50) + ->order('updated_at DESC') ->select(); if (empty($tasks)) { @@ -284,15 +286,14 @@ class Adapter implements WeChatServiceInterface - if ($passedWeChatId && !empty($task_info['msgConf'])) { + Db::name('task_customer') ->where('id', $task['id']) ->update(['status' => 4, 'updated_at' => time()]); $wechatFriendRecord = $this->getWeChatAccoutIdAndFriendIdByWeChatIdAndFriendPhone($passedWeChatId, $task['phone']); $msgConf = is_string($task_info['msgConf']) ? json_decode($task_info['msgConf'], 1) : $task_info['msgConf']; - $wechatFriendRecord && $this->sendMsgToFriend($wechatFriendRecord['id'], $wechatFriendRecord['wechatAccountId'], $msgConf); } else {