liche update for admin clues add view bug

This commit is contained in:
xxb
2021-07-26 11:01:14 +08:00
parent d825f0aa3d
commit 205b6a589f
+42
View File
@@ -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');