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'] != '') {