From 71ee5229114511a69043524da30cdeed7e501061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E6=A1=83?= <1098598843@qq.com> Date: Mon, 13 Feb 2023 16:46:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Article.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/api/controller/Article.php b/app/api/controller/Article.php index 1755e7c..316da53 100644 --- a/app/api/controller/Article.php +++ b/app/api/controller/Article.php @@ -652,6 +652,7 @@ class Article extends BaseController //根据个人id进行查询 $where[] = ['a.user_id','=',JWT_UID]; $where[] = ['b.is_read','=','0']; + $which = []; //根据个人村id进行查询 if (JWT_UID) { $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find(); @@ -664,6 +665,7 @@ class Article extends BaseController $www[] = ['a.county', '=', $find['area_id']]; } } + $which['user_id'] = JWT_UID; } $yishi = Db::table('fa_article')->alias('a')->join(['fa_article_vote_side_tables' => 'b'],'a.id=b.article_id')->where($www)->where('a.category_id',162)->whereTime('b.end_time', '>', date('Y-m-d H:i:s'))->count(); $maodun = Db::table('fa_article')->alias('a')->join(['fa_article_comment' => 'b'],'a.id=b.vote_id')->where('a.is_solve', 1)->where($where)->where('a.category_id',147)->count(); @@ -671,7 +673,7 @@ class Article extends BaseController $saohei = Db::table('fa_article')->alias('a')->join(['fa_article_comment' => 'b'],'a.id=b.vote_id')->where('a.is_solve', 1)->where($where)->where('a.category_id', 149)->count(); $sos = Db::table('fa_article')->alias('a')->join(['fa_article_comment' => 'b'],'a.id=b.vote_id')->where('a.is_solve', 1)->where($where)->where('a.category_id', 150)->count(); $one_shuqiu = Db::table('fa_article')->alias('a')->join(['fa_article_comment' => 'b'],'a.id=b.vote_id')->where('a.is_solve', 1)->where($where)->where('a.category_id', 165)->count(); - $notice = Db::table('cms_notice')->where('status',1)->where('is_read',0)->count(); + $notice = Db::table('cms_notice')->where('status',1)->where($which)->where('is_read',0)->count(); $select = [ 'yishi' => $yishi, 'maodun' => $maodun,