Commit c2b9c1f1 authored by hujun's avatar hujun

客户列表权限控制

parent 22e1cb4c
......@@ -253,6 +253,11 @@ class Member extends Basic{
try {
$data['list'] = $this->user->getUserAgent($pageNo, $pageSize, 'a.id DESC', $fields, $where, $type);
foreach ($data['list'] as $k=>$v) {
$data['list'][$k]['current_agent_id'] = $this->userId;
}
$data['total'] = $this->user->getUserAgentTotal($where, $type);
} catch (\Exception $e) {
return $this->response(101, '内部错误,获取客户失败!请联系运营。');
......@@ -266,41 +271,6 @@ class Member extends Basic{
return $return;
}
/**
* 新增客户
*
* @return \think\Response
* @throws \think\exception\DbException
*/
public function user_add() {
$params = $this->request->param();
$status = 101;
$data = $msg = '';
if (empty($params['id'])) {
$user_data = $this->user->get(['user_phone'=> $params['user_phone']]);
} else {
$user_data = $this->user->get($params['id']);
}
if (!check_phone($params['user_phone'])) {
return $this->response($status, '手机号错误');
}
if (empty($user_data) && $params['type'] == 'add') {
$this->user->edit($data);
if ($this->user->id) {
$status = 200;
$data = ['id'=>$this->user->id];
$msg = '添加用户成功';
} else {
$msg = '新增用户失败';
}
}
return $this->response($status, $msg, $data);
}
/**
* 添加跟进
*
......
......@@ -713,7 +713,7 @@ define(['doT', 'text!temp/user_template_tpl.html', 'ckfinder', 'ckfinderStart',
}
$.ajax({
url: '/index/user_add',
url: '/index/pcEditClient',
type: 'POST',
async: true,
data: params,
......
......@@ -26,7 +26,7 @@
[% if (it[item]['first_login_time'] != null){ %] [%= it[item]["first_login_time"] %] [% } %]
</td>
<td>
[% if((check_auth('auth_vip ') && it[item]['vip']) || (it[item]['agent_id'] == it[item]['current_agent_id'])) { %]
[% if((check_auth('auth_vip ') && it[item]['vip']) || (it[item]['agent_id'] == it[item]['current_agent_id']) || (check_auth('index/pcEditClient'))) { %]
<a class="btn1 btn-success caozuo" href="#modal-record" data-toggle="modal" data-phone='[%= it[item]["user_phone"] %]' data-id='[%= it[item]["id"] %]'>
详细信息
</a>
......
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