From 8525e368681a9ad04708297eab0a8e0ef54427ea Mon Sep 17 00:00:00 2001 From: hdm Date: Tue, 27 Sep 2022 22:59:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=A8=A1=E5=9D=97=E7=9A=84?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 15 +++++++++++++++ app/customer/controller/Api.php | 4 ++-- app/customer/view/contact/index.html | 1 - public/static/assets/gougu/css/gougu.css | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/app/common.php b/app/common.php index d128e4d..8ed0106 100644 --- a/app/common.php +++ b/app/common.php @@ -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() { diff --git a/app/customer/controller/Api.php b/app/customer/controller/Api.php index 9c6608f..6ea337b 100644 --- a/app/customer/controller/Api.php +++ b/app/customer/controller/Api.php @@ -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); diff --git a/app/customer/view/contact/index.html b/app/customer/view/contact/index.html index 67c156e..9a81e78 100644 --- a/app/customer/view/contact/index.html +++ b/app/customer/view/contact/index.html @@ -4,7 +4,6 @@
-
diff --git a/public/static/assets/gougu/css/gougu.css b/public/static/assets/gougu/css/gougu.css index 18c4f13..678b3f8 100644 --- a/public/static/assets/gougu/css/gougu.css +++ b/public/static/assets/gougu/css/gougu.css @@ -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}