接口修改7

This commit is contained in:
彭桃 2023-02-11 15:25:16 +08:00
parent ee6bdd743b
commit 0efd385920

View File

@ -43,27 +43,29 @@ class Article extends BaseController
//根据个人村id进行查询 //根据个人村id进行查询
if (JWT_UID) { if (JWT_UID) {
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find(); $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
if ($find) { // if ($find) {
if ($find['auth_range']==1){ // if ($find['auth_range']==1){
$where[] = ['village', '=', $find['village_id']]; // $where[] = ['village', '=', $find['village_id']];
}elseif ($find['auth_range']==2){ // }elseif ($find['auth_range']==2){
$where[] = ['township', '=', $find['street_id']]; // $where[] = ['township', '=', $find['street_id']];
}elseif ($find['auth_range']==3){ // }elseif ($find['auth_range']==3){
$where[] = ['county', '=', $find['area_id']]; // $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_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'); $cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('address_name');
}else{ }else{
$cun_arr = []; $cun_arr = [];
} }
if(isset($param['street_id']) && !empty($param['street_id'])){ if(isset($param['street_id']) && !empty($param['street_id'])){
$where[] = ['township', '=', $param['street_id']]; $where[] = ['township', '=', $param['street_id']];
} }
if(isset($param['village_id']) && !empty($param['village_id'])){ if(isset($param['village_id']) && !empty($param['village_id'])){
$where[] = ['village', '=', $param['village_id']]; $where[] = ['village', '=', $param['village_id']];
} }
//总条数 //总条数
$count = Db::table('fa_article')->where($where)->count(); $count = Db::table('fa_article')->where($where)->count();
//当月条数 //当月条数
@ -706,15 +708,15 @@ class Article extends BaseController
//根据个人村id进行查询 //根据个人村id进行查询
if (JWT_UID) { if (JWT_UID) {
$find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find(); $find = Db::table('fa_szxc_information_useraddress')->where('user_id', JWT_UID)->find();
if ($find) { // if ($find) {
if ($find['auth_range']==1){ // if ($find['auth_range']==1){
$where[] = ['village', '=', $find['village_id']]; // $where[] = ['village', '=', $find['village_id']];
}elseif ($find['auth_range']==2){ // }elseif ($find['auth_range']==2){
$where[] = ['township', '=', $find['street_id']]; // $where[] = ['township', '=', $find['street_id']];
}elseif ($find['auth_range']==3){ // }elseif ($find['auth_range']==3){
$where[] = ['county', '=', $find['area_id']]; // $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_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'); $cun_arr['cun_address'] = Db::table('fa_szxc_information_usermsg')->where('user_id', JWT_UID)->value('address_name');