diff --git a/admin/controllers/sys/city/City.php b/admin/controllers/sys/city/City.php index 0209d70f..a0577645 100755 --- a/admin/controllers/sys/city/City.php +++ b/admin/controllers/sys/city/City.php @@ -11,12 +11,16 @@ class City extends HD_Controller{ private $city = array('北京市', '上海市', '重庆市', '天津市'); + protected $log_dir; + public function __construct() { parent::__construct(); $this->load->model("area_model"); $this->load->model("sys/sys_city_model"); $this->load->model('sys/sys_area_model'); + + $this->log_dir = 'sys_' . get_class($this); } public function index() { @@ -73,6 +77,7 @@ class City extends HD_Controller{ 'city_id' => $city_id, 'firstchar' => $v['firstchar'], 'name' => $v['name'], + 'fee_carno' => sprintf('%.2f', $v['fee_carno']), 'checked' => $city_checked[$city_id] ? 1 : 0, 'countys' => $map_checked[$city_id] ? $map_checked[$city_id] : array(), ); @@ -196,6 +201,26 @@ class City extends HD_Controller{ return $this->show_json(SYS_CODE_SUCCESS,'保存成功'); } + /** + * 保存挂牌价 + * @return bool + */ + function edit_fee(){ + $lists = $this->input->post('lists'); + $lists = json_decode($lists, true); + foreach($lists as $k => $v){ + $upd = array('fee_carno' => $v['fee_carno']); + $where = array('id' => $v['id']); + //更新城市的状态 + $ret = $this->sys_city_model->update($upd, $where); + if(!$ret){ + debug_log("[error]# " . $this->sys_city_model->db->last_query(), __FUNCTION__, $this->log_dir); + } + } + + return $this->show_json(SYS_CODE_SUCCESS,'保存成功'); + } + public function del() { $id = $this->input->post('id'); diff --git a/admin/views/sys/city/lists.php b/admin/views/sys/city/lists.php index 8e528a50..53472ef3 100755 --- a/admin/views/sys/city/lists.php +++ b/admin/views/sys/city/lists.php @@ -25,6 +25,7 @@