diff --git a/Cunkebao/app/workspace/auto-like/page.tsx b/Cunkebao/app/workspace/auto-like/page.tsx index c92f8ea6..12510891 100644 --- a/Cunkebao/app/workspace/auto-like/page.tsx +++ b/Cunkebao/app/workspace/auto-like/page.tsx @@ -45,6 +45,9 @@ interface TaskConfig { tagOperator: number createTime: string updateTime: string + todayLikeCount?: number + totalLikeCount?: number + friends?: string[] } interface Task { @@ -291,35 +294,33 @@ export default function AutoLikePage() { -
+
-
执行设备:{task.config.devices.length} 个
-
目标人群:{ - task.config.targetGroups.length > 2 - ? `${task.config.targetGroups[0]} 等${task.config.targetGroups.length - 1}个标签` - : task.config.targetGroups.join(', ') - }
+
执行设备:{task.config.devices.length} 个
+
目标人群:{task.config.friends?.length || 0} 个
+
更新时间:{task.updateTime}
-
点赞间隔:{task.config.interval} 秒
-
每日上限:{task.config.maxLikes} 次
+
点赞间隔:{task.config.interval} 秒
+
每日上限:{task.config.maxLikes} 次
+
创建时间:{task.createTime}
- -
-
- - 更新时间:{task.updateTime} + +
+
+
+ + 今日点赞: + {task.config.todayLikeCount || 0} 次 +
-
- 创建时间:{task.createTime} - +
+
+ + 总点赞数: + {task.config.totalLikeCount || 0} 次 +
diff --git a/Server/application/cunkebao/controller/WorkbenchController.php b/Server/application/cunkebao/controller/WorkbenchController.php index 2aee6075..5eea7061 100644 --- a/Server/application/cunkebao/controller/WorkbenchController.php +++ b/Server/application/cunkebao/controller/WorkbenchController.php @@ -183,6 +183,22 @@ class WorkbenchController extends Controller //$item->config->targetGroups = json_decode($item->config->targetGroups, true); $item->config->contentTypes = json_decode($item->config->contentTypes, true); $item->config->friends = json_decode($item->config->friends, true); + + // 添加今日点赞数 + $startTime = strtotime(date('Y-m-d') . ' 00:00:00'); + $endTime = strtotime(date('Y-m-d') . ' 23:59:59'); + $todayLikeCount = Db::name('workbench_auto_like_item') + ->where('workbenchId', $item->id) + ->whereTime('createTime', 'between', [$startTime, $endTime]) + ->count(); + + // 添加总点赞数 + $totalLikeCount = Db::name('workbench_auto_like_item') + ->where('workbenchId', $item->id) + ->count(); + + $item->config->todayLikeCount = $todayLikeCount; + $item->config->totalLikeCount = $totalLikeCount; } unset($item->autoLike,$item->auto_like); break; @@ -293,6 +309,23 @@ class WorkbenchController extends Controller $workbench->config->friends = json_decode($workbench->config->friends, true); //$workbench->config->targetGroups = json_decode($workbench->config->targetGroups, true); $workbench->config->contentTypes = json_decode($workbench->config->contentTypes, true); + + // 添加今日点赞数 + $startTime = strtotime(date('Y-m-d') . ' 00:00:00'); + $endTime = strtotime(date('Y-m-d') . ' 23:59:59'); + $todayLikeCount = Db::name('workbench_auto_like_item') + ->where('workbenchId', $workbench->id) + ->whereTime('createTime', 'between', [$startTime, $endTime]) + ->count(); + + // 添加总点赞数 + $totalLikeCount = Db::name('workbench_auto_like_item') + ->where('workbenchId', $workbench->id) + ->count(); + + $workbench->config->todayLikeCount = $todayLikeCount; + $workbench->config->totalLikeCount = $totalLikeCount; + unset($workbench->autoLike,$workbench->auto_like); } break;