From 673df6884ca1d7c169f54742b667d1cc26204a2a Mon Sep 17 00:00:00 2001 From: xiaoyu Date: Thu, 22 May 2025 14:36:07 +0800 Subject: [PATCH] 0522 --- admin/controllers/autohome/Customer.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/admin/controllers/autohome/Customer.php b/admin/controllers/autohome/Customer.php index f921e6c5..a21764fd 100644 --- a/admin/controllers/autohome/Customer.php +++ b/admin/controllers/autohome/Customer.php @@ -441,15 +441,20 @@ class Customer extends HD_Controller $brands = $this->auto_brand_model->get_map_by_ids(array_column($rows, 'brand_id')); $series = $this->auto_series_model->get_map_by_ids(array_column($rows, 'series_id')); - $provinces = $this->area_model->get_map_by_province_ids(array_column($rows, 'province_id')); - $citys = $this->area_model->get_map_by_city_ids(array_column($rows, 'city_id')); $map_biz = $this->biz_model->map('id', 'biz_name', ['status' => 1, 'province_id' => 350000], '', 0, 0, 'id,biz_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, $size, 'city_id,province_name,city_name'); + } + foreach ($rows as $val){ $val['brand'] = $brands[$val['brand_id']][0]['name']; $val['series'] = $series[$val['series_id']][0]['name']; - $val['province'] = $provinces[$val['province_id']][0]['province_name']; - $val['city'] = $citys[$val['city_id']][0]['city_name']; + $area = $map_area_city[$val['city_id']][0]; + $val['province'] = $area['province_name']; + $val['city'] = $area['city_name']; if($val['cfrom'] == 1){ $cf2 = $this->cfrom2[$val['cfrom2']];