diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 8d68a058..40adff1e 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -123,6 +123,48 @@ class Clues extends HD_Controller{ return $this->show_view('receiver/clues/edit', true); } + /** + * 新增 + * @return bool + */ + function get_add(){ + $id = $this->input->get('id'); + + if($id){ + $row = $this->clues_model->get(array('id' => $id)); + if(!$row){ + return $this->show_json(SYS_CODE_FAIL, '记录不存在'); + } + + $info = array( + 'name' => $row['name'], + 'mobile' => $row['mobile'], + 'cf_id' => $row['cf_id'], + ); + $title = "编辑线索"; + $action = "edit"; + } else { + $info = array( + 'name' => '', + 'mobile' => '', + 'cf_id' => '', + ); + $title = "新增线索"; + $action = "add"; + } + + $where = array('status' => 1); + $select = 'id, title'; + $map_cfrom = $this->clues_cfrom_model->map('id', 'title', $where, '', 0, 0, $select); + + $this->data['info'] = $info; + $this->data['cfrom_ary'] = $map_cfrom; + $this->data['action'] = $action; + + $this->data['_title'] = $title; + return $this->show_view('receiver/clues/get'); + } + //添加单条数据 public function add(){ $info = $this->input->post('info');