Commit 342da585 authored by zfc's avatar zfc

客户编辑日志

parent 5461002c
......@@ -42,13 +42,18 @@ class Client extends Basic
*/
public function editClient() {
header('Access-Control-Allow-Origin:*');
$table=New Agents();
$data=array();
if ($this->params['user_nick'] || $this->params['user_nick'] || $this->params['id']) {
if ($this->request->isPost()) {
if ($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']);
$name=$table->where('id',$this->params['agents_id'])->value('realname');
//var_dump($name);
$remark='客方修改为 '.$name;
$this->operating_records($this->params['ccr_id'], $type=3, $remark,0,$this->params['id']);
} else {
//添加
$data['start'] = $this->user->edit($this->params);
......@@ -57,7 +62,11 @@ class Client extends Basic
$this->msg = '该客户手机号已存在于系统内';
}else{
$data['id']= $this->user->id;
$this->operating_records($this->params['ccr_id'], $type=3, $remark='用户添加',0,$data['id']);
//获取客方数据
$name=$table->where('id',$this->params['agents_id'])->value('realname');
//var_dump($name);
$remark='客方添加为 '.$name;
$this->operating_records($this->params['ccr_id'], $type=3, $remark,0,$data['id']);
}
......
......@@ -188,11 +188,13 @@ class Users extends Model
$insert_data['sex'] = $data['sex'];
if ($id) {
//修改
$insert_data['agent_id']= $data['agents_id'];
$insert_data['update_time']= date('Y-m-d H:i:s');
$this->save($insert_data,['id'=>$id]);
$return_id = $id;
} else {
//新增
$is_exist = $this->where('user_phone',$data['user_phone'])->count();
if (empty($is_exist)) {
$insert_data['referrer_id'] = $data['agents_id'];
......
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