diff --git a/Server/README_scheduler.md b/Server/README_scheduler.md index 64d7d6ebd..1b247c4a0 100644 --- a/Server/README_scheduler.md +++ b/Server/README_scheduler.md @@ -44,7 +44,7 @@ ```bash # 每分钟执行一次调度器(调度器内部会根据 cron 表达式判断哪些任务需要执行) -* * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think scheduler:run >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/scheduler.log 2>&1 +* * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think scheduler:run >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/scheduler.log 2>&1 ``` ### 4. 系统要求 diff --git a/Server/application/command/SyncWechatDataToCkbTask.php b/Server/application/command/SyncWechatDataToCkbTask.php index 671fd0b48..8ff8dd92a 100644 --- a/Server/application/command/SyncWechatDataToCkbTask.php +++ b/Server/application/command/SyncWechatDataToCkbTask.php @@ -9,7 +9,7 @@ use think\console\Command; use think\facade\App; use WeChatDeviceApi\Adapters\ChuKeBao\Adapter as ChuKeBaoAdapter; -// */7 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think sync:wechatData >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/sync_wechat_data.log 2>&1 +// */7 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think sync:wechatData >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/sync_wechat_data.log 2>&1 class SyncWechatDataToCkbTask extends Command { protected $lockFile; diff --git a/Server/application/common/model/TrafficPoolSource.php b/Server/application/common/model/TrafficPoolSource.php index f73f21969..bf34fab92 100644 --- a/Server/application/common/model/TrafficPoolSource.php +++ b/Server/application/common/model/TrafficPoolSource.php @@ -73,6 +73,43 @@ class TrafficPoolSource extends Model return $value ? json_encode($value, JSON_UNESCAPED_UNICODE) : null; } + /** + * 兼容历史库:s2_wechat_friend 早期可能不存在 headImgUrl 列 + * @param string $wechatId + * @return string + */ + protected static function getFriendHeadImgUrl(string $wechatId): string + { + $wechatId = trim($wechatId); + if ($wechatId === '') { + return ''; + } + + static $hasHeadImgUrl = null; + if ($hasHeadImgUrl === null) { + try { + $cols = Db::query("SHOW COLUMNS FROM s2_wechat_friend LIKE 'headImgUrl'"); + $hasHeadImgUrl = !empty($cols); + } catch (\Throwable $e) { + $hasHeadImgUrl = false; + } + } + + if (!$hasHeadImgUrl) { + return ''; + } + + try { + $val = Db::table('s2_wechat_friend') + ->where('wechatId', $wechatId) + ->value('headImgUrl'); + return $val ? (string)$val : ''; + } catch (\Throwable $e) { + // 兜底:避免因字段缺失导致接口直接 1054 + return ''; + } + } + /** * 获取来源类型名称 * @return string @@ -224,11 +261,10 @@ class TrafficPoolSource extends Model // 尝试获取好友头像 if (!empty($source['sourceWechatId'])) { - $sourceData['sourceAvatar'] = Db::table('ck_traffic_pool') + $avatar = Db::table('ck_traffic_pool') ->where('wechatId', $source['sourceWechatId']) - ->value('avatar') ?: Db::table('s2_wechat_friend') - ->where('wechatId', $source['sourceWechatId']) - ->value('headImgUrl') ?: ''; + ->value('avatar'); + $sourceData['sourceAvatar'] = $avatar ?: self::getFriendHeadImgUrl((string)$source['sourceWechatId']); } } else { $sourceData['chatroomOwners'] = []; @@ -448,11 +484,10 @@ class TrafficPoolSource extends Model $sourceData['chatroomInfo'] = null; // 尝试获取好友头像 if (!empty($source['sourceWechatId'])) { - $sourceData['sourceAvatar'] = Db::table('ck_traffic_pool') + $avatar = Db::table('ck_traffic_pool') ->where('wechatId', $source['sourceWechatId']) - ->value('avatar') ?: Db::table('s2_wechat_friend') - ->where('wechatId', $source['sourceWechatId']) - ->value('headImgUrl') ?: ''; + ->value('avatar'); + $sourceData['sourceAvatar'] = $avatar ?: self::getFriendHeadImgUrl((string)$source['sourceWechatId']); } } else { $sourceData['chatroomOwners'] = []; diff --git a/Server/application/job/WorkbenchGroupPushJob.php b/Server/application/job/WorkbenchGroupPushJob.php index 5594e0b52..4cd00c1ae 100644 --- a/Server/application/job/WorkbenchGroupPushJob.php +++ b/Server/application/job/WorkbenchGroupPushJob.php @@ -333,8 +333,9 @@ class WorkbenchGroupPushJob { $sendData = []; - // 内容处理 - if (!empty($content['content'])) { + // 内容处理(小程序素材 content 为 JSON,不能按文本推送) + $contentTypeNum = (int)($content['contentType'] ?? 0); + if (!empty($content['content']) && $contentTypeNum !== 5) { // 京东转链 if (!empty($config['promotionSiteId'])) { $WorkbenchController = new WorkbenchController(); @@ -430,6 +431,49 @@ class WorkbenchGroupPushJob ]; } break; + case 5: + // 小程序:content 为 JSON,与触客宝快捷语 / 存客宝表单一致(可含 body 内容消息) + $mini = json_decode($content['content'] ?? '', true); + if (is_array($mini) && ($mini['type'] ?? '') === 'miniprogram') { + $body = trim((string)($mini['body'] ?? $mini['contentMessage'] ?? $mini['message'] ?? '')); + if ($body !== '') { + if ($type == 'group') { + $sendData[] = [ + 'content' => $body, + 'msgType' => 1, + 'wechatAccountId' => $wechatAccountId, + 'wechatChatroomId' => $targetId, + ]; + } else { + $sendData[] = [ + 'content' => $body, + 'msgType' => 1, + ]; + } + } + $miniPayload = [ + 'type' => 'miniprogram', + 'title' => $mini['title'] ?? '', + 'des' => $mini['des'] ?? '', + 'gh' => $mini['gh'] ?? '', + 'pagepath' => $mini['pagepath'] ?? '', + 'previewImage' => $mini['previewImage'] ?? '', + ]; + if ($type == 'group') { + $sendData[] = [ + 'content' => $miniPayload, + 'msgType' => 49, + 'wechatAccountId' => $wechatAccountId, + 'wechatChatroomId' => $targetId, + ]; + } else { + $sendData[] = [ + 'content' => $miniPayload, + 'msgType' => 49, + ]; + } + } + break; } return $sendData; diff --git a/Server/crontab_tasks.md b/Server/crontab_tasks.md index b89b3043b..804c46fee 100644 --- a/Server/crontab_tasks.md +++ b/Server/crontab_tasks.md @@ -4,85 +4,85 @@ ```bash # 设备列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think device:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/device_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think device:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/device_list.log 2>&1 # 微信好友列表 -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechatFriends:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/wechat_friends_list.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechatFriends:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/wechat_friends_list.log 2>&1 # 微信群列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechatChatroom:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/wechat_chatroom_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechatChatroom:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/wechat_chatroom_list.log 2>&1 # 添加好友任务列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think friendTask:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/friend_task_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think friendTask:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/friend_task_list.log 2>&1 # 微信客服列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechatList:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/wechat_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechatList:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/wechat_list.log 2>&1 # 公司账号列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think account:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/account_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think account:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/account_list.log 2>&1 # 微信好友消息列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think message:friendsList >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/message_friends_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think message:friendsList >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/message_friends_list.log 2>&1 # 微信群聊消息列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think message:chatroomList >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/message_chatroom_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think message:chatroomList >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/message_chatroom_list.log 2>&1 # 部门列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think department:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/department_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think department:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/department_list.log 2>&1 # 同步内容库 -0 2 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think content:sync >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/content_sync.log 2>&1 +0 2 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think content:sync >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/content_sync.log 2>&1 # 微信群好友列表 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think groupFriends:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/group_friends_list.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think groupFriends:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/group_friends_list.log 2>&1 # 获取通话记录 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think call-recording:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/call_recording.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think call-recording:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/call_recording.log 2>&1 # 分配规则列表 -0 3 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think allotrule:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/allot_rule_list.log 2>&1 +0 3 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think allotrule:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/allot_rule_list.log 2>&1 # 自动创建分配规则 -0 4 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think allotrule:autocreate >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/allot_rule_autocreate.log 2>&1 +0 4 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think allotrule:autocreate >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/allot_rule_autocreate.log 2>&1 # 内容采集任务 -0 5 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think content:collect >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/content_collect.log 2>&1 +0 5 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think content:collect >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/content_collect.log 2>&1 # 朋友圈采集任务 -0 6 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think moments:collect >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/moments_collect.log 2>&1 +0 6 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think moments:collect >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/moments_collect.log 2>&1 # 工作台自动点赞任务 -0 7 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:autoLike >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/workbench_auto_like.log 2>&1 +0 7 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:autoLike >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/workbench_auto_like.log 2>&1 # 工作台朋友圈同步任务 -0 8 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:moments >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/workbench_moments.log 2>&1 +0 8 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:moments >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/workbench_moments.log 2>&1 # 同步微信数据到存客宝 -0 9 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think sync:wechatData >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/sync_wechat_data.log 2>&1 +0 9 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think sync:wechatData >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/sync_wechat_data.log 2>&1 # 工作台群发消息 -*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:groupPush >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/workbench_groupPush.log 2>&1 +*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:groupPush >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/workbench_groupPush.log 2>&1 # 工作台建群 -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:groupCreate >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/workbench_groupCreate.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:groupCreate >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/workbench_groupCreate.log 2>&1 # 工作台通讯录导入 -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:import-contact >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/import_contact.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:import-contact >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/import_contact.log 2>&1 # 工作台流量分发 -0 9 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:trafficDistribute >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/traffic_distribute.log 2>&1 +0 9 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:trafficDistribute >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/traffic_distribute.log 2>&1 # 预防性切换好友 -*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think switch:friends >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/switch_friends.log 2>&1 +*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think switch:friends >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/switch_friends.log 2>&1 # 消息提醒 -*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think kf:notice >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/kf_notice.log 2>&1 +*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think kf:notice >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/kf_notice.log 2>&1 # 客服评分 -0 2 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechat:calculate-score >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/calculate_score.log 2>&1 +0 2 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechat:calculate-score >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/calculate_score.log 2>&1 @@ -92,12 +92,12 @@ ## 说明 -- 所有命令都在 `/www/wwwroot/ckbapi.quwanzhi.com/Server` 目录下执行 +- 所有命令都在 `/www/wwwroot/ckbapi.quwanzhi.com` 目录下执行 - 默认只获取未删除(活跃)的设备、微信好友和群聊 - 已注释的命令(以#开头)是获取已删除或已停用数据的任务,可根据需要取消注释启用 - 每个命令的执行结果都会记录到对应的日志文件中 - 日志文件名格式包含了数据状态(如 `_active`, `_deleted`, `_stopped`) -- 日志文件位于 `/www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/` 目录下 +- 日志文件位于 `/www/wwwroot/ckbapi.quwanzhi.com/runtime/log/` 目录下 - 大部分任务每5分钟执行一次(`*/5 * * * *` 表示每小时的第0,5,10,15...55分钟执行) - 设备列表的未删除设备任务每天凌晨1点执行一次(`0 1 * * *`) - 自动创建分配规则每小时整点执行一次(`0 * * * *`) @@ -120,64 +120,64 @@ crontab -l # 设备列表 - 未删除设备(每半小时执行) -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think device:list --isDel=0 >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_device_active.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think device:list --isDel=0 >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_device_active.log 2>&1 # 设备列表 - 已删除设备(每天1点执行) -0 1 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think device:list --isDel=1 >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_device_deleted.log 2>&1 +0 1 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think device:list --isDel=1 >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_device_deleted.log 2>&1 # 设备列表 - 已停用设备(每天1:10执行) -10 1 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think device:list --isDel=2 >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_device_stopped.log 2>&1 +10 1 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think device:list --isDel=2 >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_device_stopped.log 2>&1 # 微信好友列表 - 未删除好友(每1分钟执行) -*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechatFriends:list --isDel=0 >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_wechatFriends_active.log 2>&1 +*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechatFriends:list --isDel=0 >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_wechatFriends_active.log 2>&1 # 微信好友列表 - 已删除好友(每天1:30分执行) -30 1 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechatFriends:list --isDel=1 >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_wechatFriends_deleted.log 2>&1 +30 1 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechatFriends:list --isDel=1 >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_wechatFriends_deleted.log 2>&1 # 微信群列表 - 未删除群(每5分钟执行) -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechatChatroom:list --isDel=0 >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_wechatChatroom_active.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechatChatroom:list --isDel=0 >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_wechatChatroom_active.log 2>&1 # 微信群列表 - 已删除群(每天1:30分执行) -30 1 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechatChatroom:list --isDel=1 >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_wechatChatroom_deleted.log 2>&1 +30 1 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechatChatroom:list --isDel=1 >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_wechatChatroom_deleted.log 2>&1 # 微信群好友列表(没5分钟执行) -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think groupFriends:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_groupFriends.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think groupFriends:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_groupFriends.log 2>&1 # 添加好友任务列表(每1分钟执行) -*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think friendTask:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_friendTask.log 2>&1 +*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think friendTask:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_friendTask.log 2>&1 # 微信客服列表(每5分钟执行) -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechatList:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_wechatList.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechatList:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_wechatList.log 2>&1 # 公司账号列表(每5分钟执行) -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think account:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_account.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think account:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_account.log 2>&1 # 微信好友消息列表(每30分钟执行) -*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think message:friendsList >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_messageFriends.log 2>&1 +*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think message:friendsList >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_messageFriends.log 2>&1 # 微信群聊消息列表(每30分钟执行) -*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think message:chatroomList >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_messageChatroom.log 2>&1 +*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think message:chatroomList >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_messageChatroom.log 2>&1 # 获取通话记录 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think call-recording:list >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/call_recording.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think call-recording:list >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/call_recording.log 2>&1 # 清洗微信数据 -*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think sync:wechatData >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/sync_wechat_data.log 2>&1 +*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think sync:wechatData >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/sync_wechat_data.log 2>&1 # 内容采集任务(每5分钟执行) -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think content:collect >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_contentCollect.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think content:collect >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_contentCollect.log 2>&1 # 工作台任务_自动点赞(每10分钟执行) -*/6 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:autoLike >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/crontab_workbench_autoLike.log 2>&1 +*/6 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:autoLike >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/crontab_workbench_autoLike.log 2>&1 # 每3天的3点同步所有好友 -0 3 */3 * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think sync:allFriends >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/all_friends.log 2>&1 +0 3 */3 * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think sync:allFriends >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/all_friends.log 2>&1 # 工作台流量分发 -*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:trafficDistribute >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/traffic_distribute.log 2>&1 +*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:trafficDistribute >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/traffic_distribute.log 2>&1 # 工作台朋友圈同步任务 -*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:moments >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/workbench_moments.log 2>&1 +*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:moments >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/workbench_moments.log 2>&1 # 工作台群发消息 -#*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:groupPush >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/workbench_groupPush.log 2>&1 +#*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:groupPush >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/workbench_groupPush.log 2>&1 # 预防性切换好友 -*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think switch:friends >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/switch_friends.log 2>&1 +*/2 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think switch:friends >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/switch_friends.log 2>&1 # 工作台建群 -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:groupCreate >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/workbench_groupCreate.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:groupCreate >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/workbench_groupCreate.log 2>&1 # 工作台通讯录导入 -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:import-contact >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/import_contact.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:import-contact >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/import_contact.log 2>&1 # 工作台入群欢迎语 -*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think workbench:groupWelcome >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/workbench_groupWelcome.log 2>&1 +*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think workbench:groupWelcome >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/workbench_groupWelcome.log 2>&1 # 消息提醒 -*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think kf:notice >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/kf_notice.log 2>&1 +*/1 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think kf:notice >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/kf_notice.log 2>&1 # 客服评分 -0 2 * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think wechat:calculate-score >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/calculate_score.log 2>&1 +0 2 * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think wechat:calculate-score >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/calculate_score.log 2>&1 # 采集客服自己的朋友圈 -*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think own:moments:collect >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/own_moments_collect.log 2>&1 +*/30 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think own:moments:collect >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/own_moments_collect.log 2>&1 # 检查未读/未回复消息并自动迁移好友 -*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think check:unread-message --minutes=30 >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/check_unread_message.log 2>&1 +*/5 * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think check:unread-message --minutes=30 >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/check_unread_message.log 2>&1 # 每分钟执行一次调度器(调度器内部会自动判断哪些任务需要执行) -* * * * * cd /www/wwwroot/ckbapi.quwanzhi.com/Server && php think scheduler:run >> /www/wwwroot/ckbapi.quwanzhi.com/Server/runtime/log/scheduler.log 2>&1 +* * * * * cd /www/wwwroot/ckbapi.quwanzhi.com && php think scheduler:run >> /www/wwwroot/ckbapi.quwanzhi.com/runtime/log/scheduler.log 2>&1