From 3a00e8962cf5787cb37ed4069016261a3d9a6fc8 Mon Sep 17 00:00:00 2001 From: hdm Date: Sat, 4 Feb 2023 15:19:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E6=A8=A1=E5=9D=97=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=8C=89=E7=85=A7=E6=89=80=E5=B1=9E=E5=91=98=E5=B7=A5?= =?UTF-8?q?=E6=A3=80=E7=B4=A2=EF=BC=8C=E5=AE=A1=E6=89=B9=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=BD=AC=E6=AD=A3=E3=80=81=E7=A6=BB=E8=81=8C=E3=80=81=E8=BD=AC?= =?UTF-8?q?=E5=B2=97=E5=AE=A1=E6=89=B9=E6=B7=BB=E5=8A=A0=E6=97=B6=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E9=80=89=E6=8B=A9=E6=95=88=E6=9E=9C=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/customer/controller/Index.php | 108 ++++++++++++++--------- app/customer/view/index/index.html | 52 ++++++++++- app/customer/view/index/sea.html | 10 +++ app/customer/view/index/trash.html | 10 +++ app/home/controller/Login.php | 2 +- app/install/data/gouguoa.sql | 8 +- app/oa/view/approve/add_lizhi.html | 10 ++- app/oa/view/approve/add_zhuangang.html | 10 ++- app/oa/view/approve/add_zhuanzheng.html | 10 ++- app/user/validate/DepartmentCheck.php | 3 +- public/static/assets/gougu/css/gougu.css | 4 +- 11 files changed, 167 insertions(+), 60 deletions(-) diff --git a/app/customer/controller/Index.php b/app/customer/controller/Index.php index 2154e5b..f38a6f8 100644 --- a/app/customer/controller/Index.php +++ b/app/customer/controller/Index.php @@ -44,49 +44,54 @@ class Index extends BaseController $uid = $this->uid; $auth = isAuth($uid,'customer_admin'); - $dids = get_department_role($uid); - if($auth==0){ - if($tab==1){ - $whereOr[] =['a.belong_uid', '=', $uid]; - } - else if($tab==2){ - 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)")]; - } - else{ - $whereOr[] =['a.belong_uid', '=', $uid]; - if(!empty($dids)){ - $whereOr[] =['a.belong_did', 'in', $dids]; - } - $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.share_ids)")]; - } + if (!empty($param['uid']) && $auth == 1) { + $where[] =['a.belong_uid', '=', $param['uid']]; } - else if($auth==1){ - if($tab==1){ - $whereOr[] =['a.belong_uid', '=', $uid]; - } - else if($tab==2){ - if(!empty($dids)){ - $whereOr[] =['a.belong_did', 'in', $dids]; + else{ + $dids = get_department_role($uid); + if($auth == 0){ + if($tab == 1){ + $whereOr[] =['a.belong_uid', '=', $uid]; + } + else if($tab == 2){ + 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)")]; } else{ - $whereOr[] =['a.belong_did', '=', 0]; - $where[] =['a.belong_uid', '>', 0]; + $whereOr[] =['a.belong_uid', '=', $uid]; + if(!empty($dids)){ + $whereOr[] =['a.belong_did', 'in', $dids]; + } + $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.share_ids)")]; } } - else if($tab==3){ - $whereOr[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',a.share_ids)")]; - } - else{ - $whereOr[] =['a.belong_uid', '>', 0]; + else if($auth ==1 ){ + if($tab == 1){ + $whereOr[] =['a.belong_uid', '=', $uid]; + } + else if($tab == 2){ + 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)")]; + } + else{ + $whereOr[] =['a.belong_uid', '>', 0]; + } } } @@ -105,7 +110,13 @@ class Index extends BaseController ->paginate($rows, false, ['query' => $param]) ->each(function ($item, $key) { $item->belong_name = Db::name('Admin')->where(['id' => $item->belong_uid])->value('name'); - $item->create_time = date('Y-m-d H:i:s', (int) $item->create_time); + $item->create_time = date('Y-m-d H:i', $item->create_time); + if($item->update_time == 0){ + $item->update_time='-'; + } + else{ + $item->update_time = date('Y-m-d H:i', $item->update_time); + } $item->intent_status_name = CustomerList::$IntentStatus[(int) $item->intent_status]; $item->status_name = CustomerList::$Status[(int) $item->status]; $contact = Db::name('CustomerContact')->where(['is_default'=>1,'cid' => $item->id])->find(); @@ -125,6 +136,9 @@ class Index extends BaseController }); return table_assign(0, '', $content); } else { + $uid = $this->uid; + $auth = isAuth($uid,'customer_admin'); + View::assign('auth', $auth); return view(); } } @@ -162,7 +176,13 @@ class Index extends BaseController ->paginate($rows, false, ['query' => $param]) ->each(function ($item, $key) { $item->belong_name = Db::name('Admin')->where(['id' => $item->belong_uid])->value('name'); - $item->create_time = date('Y-m-d H:i:s', (int) $item->create_time); + $item->create_time = date('Y-m-d H:i', $item->create_time); + if($item->update_time == 0){ + $item->update_time='-'; + } + else{ + $item->update_time = date('Y-m-d H:i', $item->update_time); + } $item->intent_status_name = CustomerList::$IntentStatus[(int) $item->intent_status]; $item->status_name = CustomerList::$Status[(int) $item->status]; $contact = Db::name('CustomerContact')->where(['is_default'=>1,'cid' => $item->id])->find(); @@ -245,7 +265,13 @@ class Index extends BaseController ->paginate($rows, false, ['query' => $param]) ->each(function ($item, $key) { $item->belong_name = Db::name('Admin')->where(['id' => $item->belong_uid])->value('name'); - $item->create_time = date('Y-m-d H:i:s', (int) $item->create_time); + $item->create_time = date('Y-m-d H:i', $item->create_time); + if($item->update_time == 0){ + $item->update_time='-'; + } + else{ + $item->update_time = date('Y-m-d H:i', $item->update_time); + } $item->intent_status_name = CustomerList::$IntentStatus[(int) $item->intent_status]; $item->status_name = CustomerList::$Status[(int) $item->status]; $contact = Db::name('CustomerContact')->where(['is_default'=>1,'cid' => $item->id])->find(); diff --git a/app/customer/view/index/index.html b/app/customer/view/index/index.html index a8f5e05..aa04475 100644 --- a/app/customer/view/index/index.html +++ b/app/customer/view/index/index.html @@ -12,7 +12,7 @@ -
+
+ {eq name="$auth" value="1"} +
+ + +
+ {/eq}
+
@@ -68,9 +75,34 @@ {block name="script"}