From 141b8c2cd8665c21683c9b66574ae7704d2e69e9 Mon Sep 17 00:00:00 2001 From: chenbo <709206448@qq.com> Date: Sun, 8 Oct 2023 11:56:20 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=E9=95=87=E5=86=9C=E7=A7=91?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=88=86=E8=A7=92=E8=89=B2=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E8=87=AA=E5=B7=B1=E7=9A=84=E4=BB=BB=E5=8A=A1=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/TaskController.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/app/api/controller/TaskController.php b/app/api/controller/TaskController.php index 97c90ded5..11793cad6 100644 --- a/app/api/controller/TaskController.php +++ b/app/api/controller/TaskController.php @@ -25,17 +25,25 @@ class TaskController extends BaseApiController $param = Request()->param(); [$page, $limit] = $this->getPage(); $time = strtotime(date('Y-m-d')); - if ($this->userInfo['admin_id'] != 0) { - $where[] = ['company_id', '=', $this->userInfo['company_id']]; - } else { - - $is_captain = User::where('id', $this->userId)->value('is_captain'); - if ($is_captain == 1) { - $where[] = ['type', 'in', [31,33]]; + $userCompanyInfo = Company::where('id', $this->userInfo['company_id'])->find(); + if ($userCompanyInfo['company_type'] == 18) { + if ($this->userInfo['admin_id'] != 0) { + $where[] = ['company_id', '=', $this->userInfo['company_id']]; } else { - $where[] = ['type', '=', 33]; - $where[] = ['director_uid', '=', $this->userId]; + + $is_captain = User::where('id', $this->userId)->value('is_captain'); + if ($is_captain == 1) { + $where[] = ['type', 'in', [31,33]]; + } else { + $where[] = ['type', '=', 33]; + $where[] = ['director_uid', '=', $this->userId]; + } + $where[] = ['company_id', '=', $this->userInfo['company_id']]; } + } + + if ($userCompanyInfo['company_type'] == 41) { + $where[] = ['director_uid', '=', $this->userId]; $where[] = ['company_id', '=', $this->userInfo['company_id']]; } if (isset($param['date_time']) && $param['date_time'] != '') {