From 739c5c8623a9283f0ea3880985a75cfe85589e24 Mon Sep 17 00:00:00 2001 From: hdm Date: Sun, 25 Sep 2022 12:52:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E5=B1=9E=E5=AE=A2=E6=88=B7=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=95=B0=E6=8D=AE=E9=97=AE=E9=A2=98=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/customer/controller/Index.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/customer/controller/Index.php b/app/customer/controller/Index.php index 4701569..cdcb0aa 100644 --- a/app/customer/controller/Index.php +++ b/app/customer/controller/Index.php @@ -44,7 +44,7 @@ class Index extends BaseController $uid = $this->uid; $auth = isAuth($uid,'customer_admin'); - $dids = get_department_role($this->uid); + $dids = get_department_role($uid); if($auth==0){ if($tab==1){ $whereOr[] =['a.belong_uid', '=', $uid]; @@ -55,6 +55,7 @@ class Index extends BaseController } else{ $whereOr[] =['a.belong_did', '=', 0]; + $where[] =['a.belong_uid', '>', 0]; } } else if($tab==3){ @@ -76,6 +77,10 @@ class Index extends BaseController if(!empty($dids)){ $whereOr[] =['a.belong_did', 'in', $dids]; } + else{ + $whereOr[] =['a.belong_did', '=', 0]; + $where[] =['a.belong_uid', '>', 0]; + } } else if($tab==3){ $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.share_ids)")]; @@ -372,10 +377,11 @@ class Index extends BaseController } } else { if (!empty($param['id']) && $param['id'] > 0) { - $id = get_params("id"); + $sea = isset($param['sea']) ? $param['sea'] : 0; //查看权限判断 - $customer = customer_auth($this->uid,$id); - $detail = (new CustomerList())->detail($id); + $customer = customer_auth($this->uid,$param['id']); + $detail = (new CustomerList())->detail($param['id']); + View::assign('sea', $sea); View::assign('detail', $detail); return view('edit'); } @@ -397,6 +403,9 @@ class Index extends BaseController $detail = (new CustomerList())->detail($id); $contact = Db::name('CustomerContact')->where(['is_default'=>1,'cid'=>$id])->find(); + //是否是客户管理员 + $auth = isAuth($this->uid,'customer_admin'); + View::assign('auth', $auth); View::assign('contact', $contact); View::assign('detail', $detail); return view();