diff --git a/app/api/controller/Article.php b/app/api/controller/Article.php index cf40d2b..280cabc 100644 --- a/app/api/controller/Article.php +++ b/app/api/controller/Article.php @@ -689,12 +689,27 @@ class Article extends BaseController if (!$category_id) { unset($where[1]); } - $village_id = get_params('village_id'); - if ($village_id) { - $where[] = ['village', '=', $village_id]; + //根据个人村id进行查询 + if (JWT_UID) { + $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find(); + if ($find) { + if ($find['auth_range']==1){ + $where[] = ['village', '=', $find['village_id']]; + }elseif ($find['auth_range']==2){ + $where[] = ['township', '=', $find['street_id']]; + }elseif ($find['auth_range']==3){ + $where[] = ['county', '=', $find['area_id']]; + } + } } +// $village_id = get_params('village_id'); +// +// if ($village_id) { +// $where[] = ['village', '=', $village_id]; +// } + //总条数 $count = Db::table('fa_article')->where($where)->count(); //当月条数