修改获取线索城市
This commit is contained in:
@@ -372,12 +372,23 @@ class Clues extends BaseController
|
||||
$rows = $this->clues_model->select($where, $sort_order, $page, $limit);
|
||||
$users = $this->pingan_users_model->get_map_by_ids(array_column($rows, 'pingan_user_id'), 'id,userCode,username,centerNumber,orgName');
|
||||
//所在地区
|
||||
$map_area_county = [];
|
||||
$county_id_arr = array_filter(array_unique(array_column($rows, 'county_id')));
|
||||
if ($county_id_arr) {
|
||||
$str_ids = implode(',', $county_id_arr);
|
||||
$map_area_county = $this->area_model->map('county_id', '', ["county_id in ({$str_ids})" => null], '', 0, 0, 'county_id,province_name,city_name,county_name');
|
||||
}
|
||||
|
||||
$city_id_arr = array_filter(array_unique(array_column($rows, 'city_id')));
|
||||
if ($city_id_arr) {
|
||||
$str_ids = implode(',', $city_id_arr);
|
||||
$map_area_city = $this->area_model->map('city_id', '', ["city_id in ({$str_ids})" => null], '', 0, 0, 'city_id,province_name,city_name');
|
||||
}
|
||||
|
||||
$province_id_arr = array_filter(array_unique(array_column($rows, 'province_id')));
|
||||
if ($province_id_arr) {
|
||||
$str_ids = implode(',', $province_id_arr);
|
||||
$map_area_province = $this->area_model->map('province_id', '', ["province_id in ({$str_ids})" => null], '', 0, 0, 'province_id,province_name');
|
||||
}
|
||||
foreach ($rows as $v) {
|
||||
$belongUserName = $users[$v['pingan_user_id']] ? $users[$v['pingan_user_id']][0] : '';
|
||||
$brandList = $this->receiver_enroll_model->getBrandsByMobile($v['mobile']);
|
||||
@@ -385,7 +396,13 @@ class Clues extends BaseController
|
||||
$area = '';
|
||||
if ($v['county_id']) {
|
||||
$area = $map_area_county[$v['county_id']][0];
|
||||
$poi = "{$area['province_name']}-{$area['city_name']}-{$area['county_name']}";
|
||||
$v['poi'] = "{$area['province_name']}-{$area['city_name']}-{$area['county_name']}";
|
||||
} elseif ($v['city_id']) {
|
||||
$area = $map_area_city[$v['city_id']][0];
|
||||
$v['poi'] = "{$area['province_name']}-{$area['city_name']}";
|
||||
} elseif ($v['province_id']) {
|
||||
$area = $map_area_province[$v['province_id']][0];
|
||||
$v['poi'] = "{$area['province_name']}";
|
||||
}
|
||||
$status_name = $statusAry[$v['status']]['name'];
|
||||
$v['status2'] && $status_name .= '‒' . $statusAry[$v['status']]['list'][$v['status2']];
|
||||
|
||||
Reference in New Issue
Block a user