This commit is contained in:
彭桃 2023-01-31 11:40:32 +08:00
parent 2769bf6035
commit 7b3783706d

View File

@ -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();
//当月条数