客户模块的搜索优化
This commit is contained in:
parent
8476f2f9ac
commit
8525e36868
@ -261,6 +261,21 @@ function get_department_role($uid = 0)
|
||||
}
|
||||
}
|
||||
|
||||
//读取是否是某员工的上级领导
|
||||
function get_user_role($leader_id=0,$uid = 0)
|
||||
{
|
||||
$did = get_admin($uid)['did'];
|
||||
//获取子部门
|
||||
$department = get_department();
|
||||
$department_list = get_data_node($department, $did);
|
||||
$department_array = array_column($department_list, 'id');
|
||||
//包括自己部门在内
|
||||
$department_array[] = $did;
|
||||
//判断是否是部门负责人
|
||||
$is_leader = Db::name('Department')->where([['id','in',$did,'leader_id'=>$leader_id]])->count();
|
||||
return $is_leader;
|
||||
}
|
||||
|
||||
//读取职位
|
||||
function get_position()
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ class Api extends BaseController
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
$param['update_time'] = time();
|
||||
$old = CustomerTrace::where(['id' => $param['id']])->find();
|
||||
if($this->uid!=$old['admin_id']){
|
||||
if($this->uid!=$old['admin_id'] && get_user_role($this->uid,$old['admin_id'])==0){
|
||||
return to_assign(1, "只有所属员工才有权限操作");
|
||||
}
|
||||
$res = CustomerTrace::strict(false)->field(true)->update($param);
|
||||
@ -199,7 +199,7 @@ class Api extends BaseController
|
||||
if (!empty($param['id']) && $param['id'] > 0) {
|
||||
$param['update_time'] = time();
|
||||
$old = CustomerChance::where(['id' => $param['id']])->find();
|
||||
if($this->uid!=$old['admin_id']){
|
||||
if($this->uid!=$old['admin_id'] && get_user_role($this->uid,$old['admin_id'])==0){
|
||||
return to_assign(1, "只有所属员工才有权限操作");
|
||||
}
|
||||
$res = CustomerChance::strict(false)->field(true)->update($param);
|
||||
|
@ -4,7 +4,6 @@
|
||||
<div class="p-3">
|
||||
<form class="layui-form gg-form-bar border-x border-t">
|
||||
<div class="layui-input-inline" style="width:300px;">
|
||||
<input type="hidden" name="tab" value="0" />
|
||||
<input type="text" name="keywords" placeholder="输入关键字" class="layui-input" autocomplete="off" />
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">提交搜索</button>
|
||||
|
@ -22,6 +22,7 @@
|
||||
.layui-btn-primary:hover{border-color:#3c9cff;color:#3c9cff}
|
||||
.layui-btn-group .layui-btn-primary:hover{color:#3c9cff}
|
||||
.layui-btn-reset {height: 38px;background-color: #fff; line-height: 38px; border: 1px solid transparent;padding: 0 12px; white-space: nowrap; color: #767a82;font-size: 14px;cursor: pointer;vertical-align: middle;}
|
||||
.layui-btn-reset:hover{color: #333333;}
|
||||
.layui-laypage .layui-laypage-curr .layui-laypage-em{background-color: #47B347;}
|
||||
|
||||
.layui-tab-brief>.layui-tab-title .layui-this{color:#187FDD}
|
||||
|
Loading…
x
Reference in New Issue
Block a user