diff --git a/Server/application/api/controller/WebSocketController.php b/Server/application/api/controller/WebSocketController.php index c3b0a108..4f8fd2c4 100644 --- a/Server/application/api/controller/WebSocketController.php +++ b/Server/application/api/controller/WebSocketController.php @@ -217,7 +217,7 @@ class WebSocketController extends BaseController $wechatAccountId = !empty($data['wechatAccountId']) ? $data['wechatAccountId'] : ''; $wechatFriendId = !empty($data['wechatFriendId']) ? $data['wechatFriendId'] : 0; $prevSnsId = !empty($data['prevSnsId']) ? $data['prevSnsId'] : 0; - $maxPages = 20; // 最大页数限制为20 + $maxPages = 1; // 最大页数限制为20 $currentPage = 1; // 当前页码 $allMoments = []; // 存储所有朋友圈数据 diff --git a/Server/application/cunkebao/controller/WorkbenchController.php b/Server/application/cunkebao/controller/WorkbenchController.php index b0dbc5e5..bd365025 100644 --- a/Server/application/cunkebao/controller/WorkbenchController.php +++ b/Server/application/cunkebao/controller/WorkbenchController.php @@ -649,24 +649,12 @@ class WorkbenchController extends Controller $page = $this->request->param('page', 1); $limit = $this->request->param('limit', 10); $workbenchId = $this->request->param('workbenchId', 0); - $startTime = $this->request->param('startTime', ''); - $endTime = $this->request->param('endTime', ''); $where = [ ['wali.workbenchId', '=', $workbenchId] ]; - // 添加时间筛选 - if (!empty($startTime) && !empty($endTime)) { - $where[] = ['wali.createTime', 'between', [ - strtotime($startTime . ' 00:00:00'), - strtotime($endTime . ' 23:59:59') - ]]; - } elseif (!empty($startTime)) { - $where[] = ['wali.createTime', '>=', strtotime($startTime . ' 00:00:00')]; - } elseif (!empty($endTime)) { - $where[] = ['wali.createTime', '<=', strtotime($endTime . ' 23:59:59')]; - } + // 查询点赞记录 $list = Db::name('workbench_auto_like_item')->alias('wali') @@ -686,7 +674,9 @@ class WorkbenchController extends Controller 'wm.createTime as momentTime', 'wm.userName', 'wa.nickName as operatorName', + 'wa.avatar as operatorAvatar', 'wf.nickName as friendName', + 'wf.avatar as friendAvatar', ]) ->where($where) ->order('wali.createTime', 'desc') diff --git a/Server/application/job/WorkbenchJob.php b/Server/application/job/WorkbenchJob.php index 8c380c88..17c94728 100644 --- a/Server/application/job/WorkbenchJob.php +++ b/Server/application/job/WorkbenchJob.php @@ -227,22 +227,21 @@ class WorkbenchJob */ protected function handleAutoLike($workbench, $config) { + if (!$this->validateAutoLikeConfig($workbench, $config)) { return; } - // 验证是否达到点赞次数上限 $likeCount = $this->getTodayLikeCount($workbench, $config); if ($likeCount >= $config['maxLikes']) { Log::info("工作台 {$workbench->id} 点赞次数已达上限"); return; } - // 验证是否在点赞时间范围内 if (!$this->isWithinLikeTimeRange($config)) { return; } - + // 处理分页获取好友列表 $this->processAllFriends($workbench, $config); } @@ -261,6 +260,8 @@ class WorkbenchJob return; } + + foreach ($friendList as $friend) { // 验证是否达到好友点赞次数上限 $friendMaxLikes = Db::name('workbench_auto_like_item') @@ -542,10 +543,11 @@ class WorkbenchJob { $friends = json_decode($config['friends'], true); $devices = json_decode($config['devices'], true); + $list = Db::table('s2_company_account') ->alias('ca') ->join(['s2_wechat_account' => 'wa'], 'ca.id = wa.deviceAccountId') - ->join(['s2_wechat_friend' => 'wf'], 'ca.id = wf.accountId') + ->join(['s2_wechat_friend' => 'wf'], 'ca.id = wf.accountId AND wf.wechatAccountId = wa.id') ->where([ 'ca.status' => 0, 'wf.isDeleted' => 0,