This commit is contained in:
彭桃 2023-02-11 18:01:50 +08:00
parent e34dcb9f69
commit 793b32779d

View File

@ -43,15 +43,15 @@ class Article extends BaseController
//根据个人村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']];
// }
// }
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']];
}
}
// 登录返回村名和村地址
$cun_arr['cun_name'] = Db::table('fa_geo_village')->where('village_id', $find['village_id'])->value('village_name');
$cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('address_name');
@ -708,15 +708,15 @@ class Article extends BaseController
//根据个人村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']];
// }
// }
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']];
}
}
// 登录返回村名和村地址
$cun_arr['cun_name'] = Db::table('fa_geo_village')->where('village_id', $find['village_id'])->value('village_name');
$cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('address_name');