Commit c81f5663 authored by zfc's avatar zfc Committed by hujun

编辑跟进

parent 0e5cb1a3
...@@ -16,10 +16,13 @@ use think\session; ...@@ -16,10 +16,13 @@ use think\session;
*/ */
class Member extends Basic{ class Member extends Basic{
protected $user; protected $user;
protected $code = 200;
protected $msg = '';
public function __construct(Request $request = null) public function __construct(Request $request = null)
{ {
parent::__construct($request); parent::__construct($request);
$this->user = new Users(); $this->user = new Users();
} }
public function index() { public function index() {
...@@ -157,6 +160,37 @@ class Member extends Basic{ ...@@ -157,6 +160,37 @@ class Member extends Basic{
} }
} }
/**
* 查看或编辑客户
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function pcEditClient() {
$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(Session::get("userinfo.id"), $type=3, $remark='用户编辑',0,$this->params['id']);
}
} else {
$data['list'] = $this->user->getClient($this->params['id']);
}
} else {
$this->code = 101;
$this->msg = 'user_nick or user_phone or id is null';
}
return $this->response($this->code, $this->msg,$data);
}
/** /**
* 删除用户 * 删除用户
* @return \think\Response * @return \think\Response
......
...@@ -196,7 +196,7 @@ class Users extends Model ...@@ -196,7 +196,7 @@ class Users extends Model
*/ */
public function getClient($id) { public function getClient($id) {
if ($id) { if ($id) {
$data = $this->field('a.user_nick,a.user_phone,a.sex,a.agent_id,b.realname,b.phone') $data = $this->field('a.id as user_id,a.user_nick,a.user_phone,a.sex,a.agent_id,a.create_time,b.realname,b.phone')
->alias('a') ->alias('a')
->join('agents b','a.agent_id=b.id', 'left') ->join('agents b','a.agent_id=b.id', 'left')
->where('a.id',$id)->find(); ->where('a.id',$id)->find();
......
...@@ -48,6 +48,7 @@ Route::group('index', [ ...@@ -48,6 +48,7 @@ Route::group('index', [
'user_add' => ['index/member/user_add',['method'=>'post']], 'user_add' => ['index/member/user_add',['method'=>'post']],
'del_user' => ['index/member/delUser',['method'=>'post']], 'del_user' => ['index/member/delUser',['method'=>'post']],
'pcAddFollow' => ['index/member/pcAddFollow',['method'=>'post']], 'pcAddFollow' => ['index/member/pcAddFollow',['method'=>'post']],
'pcEditClient' => ['index/member/pcEditClient',['method'=>'post | get']],
//transfer转铺列表 //transfer转铺列表
'transfer_list' => ['index/transfer/index', ['method' => 'get']], 'transfer_list' => ['index/transfer/index', ['method' => 'get']],
......
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