自动点赞 支持打标签

This commit is contained in:
wong
2025-05-16 18:43:11 +08:00
parent 950a06b8a7
commit b3b1dde54a
3 changed files with 10 additions and 18 deletions

View File

@@ -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,