diff --git a/admin/controllers/Common.php b/admin/controllers/Common.php index a264aa63..9b41c4d2 100644 --- a/admin/controllers/Common.php +++ b/admin/controllers/Common.php @@ -35,7 +35,7 @@ class Common extends CI_Controller $this->data = $city; break; case 'county': - $this->data = $this->area_model->county($id); + $this->data = $this->area_model->county($id, $type); break; default: $this->data = $this->area_model->province(); diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 34dd9e1c..e8d2457f 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -136,6 +136,21 @@ class Clues extends HD_Controller $intention['cor_name'] = '车身颜色:' . ($jsondata['car']['color']['title'] ? $jsondata['car']['color']['title'] : ''); $info_show['intention'] = $intention; + //获取城市区域 + $city_id = ''; + $county_id = ''; + if($jsondata['info'] && $jsondata['info']['city_code']){ + $city_code = $jsondata['info']['city_code']; + if('0' === $city_code[5]){ + $city_id = $city_code; + } else { + $county_id = $city_code; + $city_id = substr_replace($county_id, '00', 4, 2); + } + } + $dataInfo['city_id'] = $city_id; + $dataInfo['county_id'] = $county_id; + $autoList[1] = $this->mdAutoBrand->select(array('status' => 1), 'id desc', 0, 0, 'id,name'); if ($re['brand_id']) { $autoList[2] = $this->mdAutoSeries->select(array('status' => 1, 'brand_id' => $re['brand_id']), 'id desc', 0, 0, 'id,name'); @@ -331,6 +346,14 @@ class Clues extends HD_Controller $jsondata = $re['jsondata'] ? json_decode($re['jsondata'], true) : array(); $jsondata['car']['version']['id'] = intval($info['v_id']); $jsondata['car']['color']['id'] = intval($info['cor_id']); + if($info['city_id'] || $info['county_id']){ + $jsondata['info']['city_code'] = $info['county_id'] ? $info['county_id'] : $info['city_id']; + } else { + if($jsondata['info'] && $jsondata['info']['city_code']){ + unset($jsondata['info']['city_code']); + } + } + $ret = $this->clues_model->update(array('brand_id' => $info['brand_id'], 's_id' => $info['s_id'], 'jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE)), array('id' => $info['id'])); if (!$ret) { diff --git a/admin/views/receiver/clues/edit.php b/admin/views/receiver/clues/edit.php index c915a8f7..60482e45 100644 --- a/admin/views/receiver/clues/edit.php +++ b/admin/views/receiver/clues/edit.php @@ -68,7 +68,7 @@