From 4bd22188deb1b2d5d156c94bad946faaf36b4508 Mon Sep 17 00:00:00 2001 From: "zhangf@suq.cn" Date: Wed, 17 Dec 2025 14:53:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(user):=20=E7=BB=9F=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在统计数据查询中添加 delete_time = 0 的过滤条件 - 修改 distillationWord、portraitLibrary、aiCommand、creationArticle 和 question 的 count 查询逻辑 - 在 createStatistic 方法中构建统一查询条件并应用到 creationArticle 的 count 查询中 --- app/service/user/IndexService.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/app/service/user/IndexService.php b/app/service/user/IndexService.php index 8968437..9714088 100644 --- a/app/service/user/IndexService.php +++ b/app/service/user/IndexService.php @@ -34,21 +34,24 @@ class IndexService extends BaseService */ public function processStatistic() { + $query = [ + 'delete_time' => 0 + ]; return [ //蒸馏词 - 'word' => $this->distillationWordDao->count(), + 'word' => $this->distillationWordDao->count($query), //图库 - 'library' => $this->portraitLibraryDao->count(), + 'library' => $this->portraitLibraryDao->count($query), //指令 - 'command' => $this->aiCommandDao->count(), + 'command' => $this->aiCommandDao->count($query), //AI创作 - 'ai' => $this->creationArticleDao->count(), + 'ai' => $this->creationArticleDao->count($query), //授权账号 'account' => 0, //投喂任务 'task' => 0, //训练问题 - 'question' => $this->questionDao->count(), + 'question' => $this->questionDao->count($query), //收录问题 'collect' => 0, //媒体投喂 @@ -80,15 +83,17 @@ class IndexService extends BaseService public function createStatistic() { $dates = []; + $query = [ + 'delete_time' => 0 + ]; for ($i = 0; $i < 5; $i++) { $dates[]['date'] = date('Y-m-d', strtotime("-{$i} days")); } foreach ($dates as &$date) { $begin = strtotime($date['date']); $end = strtotime("+1 day", $begin); - $date['count'] = $this->creationArticleDao->count([ - ['create_time', 'between', [$begin, $end]], - ]); + $query[] = ['create_time', 'between', [$begin, $end]]; + $date['count'] = $this->creationArticleDao->count($query); } return $dates; }