Commit 18db38d9 authored by hujun's avatar hujun

修改新增或编辑客户

parent 4bacfde5
......@@ -43,37 +43,33 @@ class Client extends Basic
*/
public function editClient() {
header('Access-Control-Allow-Origin:*');
$table=New Agents();
$data=array();
if (!empty($this->params['user_nick']) || !empty($this->params['id'])) {
$data = [];
if ($this->request->isPost()) {
if (!empty($this->params['id'])) {
//编辑
//编辑
$data['start'] = $this->user->edit($this->params, $this->params['id']);
$this->operating_records($this->params['ccr_id'], $type=3, $remark='用户编辑',0,$this->params['id']);
} else {
$table = new AAgents();
//添加
$data['start'] = $this->user->edit($this->params);
if ($data['start'] != 1) {
$this->code = 101;
$this->msg = '该用户已存在';
}
if($data['start']==1){
} elseif ($data['start'] == 1){
$data['id']= $this->user->id;
$this->operating_records($this->params['ccr_id'], $type=3, $remark='用户添加',0,$data['id']);
}else{
} else {
$data['id']= $this->user->id;
//获取客方数据
$name=$table->where('id',$this->params['agents_id'])->value('realname');
//var_dump($name);
$remark='客方添加为 '.$name;
$name = $table->where('id',$this->params['agents_id'])->value('name');
$remark = '客方添加为 '.$name;
$this->operating_records($this->params['ccr_id'], $type=3, $remark,0,$data['id']);
}
}
} else {
$data['start'] = $this->user->getClient($this->params['id']);
......
......@@ -203,6 +203,7 @@ class Users extends Model
$insert_data['status'] = -1;
$insert_data['create_time'] = date('Y-m-d H:i:s');
$return_id = $this->save($insert_data);
$return_id = 1;
} else {
$return_id = -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment