This commit is contained in:
xiaoyu
2025-05-22 14:24:25 +08:00
parent 5e0ecb7dde
commit 9b88d884f5
2 changed files with 30 additions and 2 deletions
+2 -2
View File
@@ -441,8 +441,8 @@ 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_ids(array_column($rows, 'province_id'));
$citys = $this->area_model->get_map_by_ids(array_column($rows, 'city_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');
foreach ($rows as $val){
+28
View File
@@ -96,4 +96,32 @@ class Area_model extends HD_Model
}
return $rows;
}
public function get_map_by_city_ids($ids, $fileds = '', $map_key = 'id')
{
$rows = [];
$ids = array_filter($ids);
if ($ids) {
$cf_ids = implode(',', $ids);
$where = [
"city_id in ($cf_ids)" => null
];
$rows = $this->map($map_key, '', $where, '', '', '', $fileds);
}
return $rows;
}
public function get_map_by_province_ids($ids, $fileds = '', $map_key = 'id')
{
$rows = [];
$ids = array_filter($ids);
if ($ids) {
$cf_ids = implode(',', $ids);
$where = [
"province_id in ($cf_ids)" => null
];
$rows = $this->map($map_key, '', $where, '', '', '', $fileds);
}
return $rows;
}
}