update:镇农科任务分角色查看自己的任务列表

This commit is contained in:
chenbo 2023-10-08 11:56:20 +08:00
parent a57282c551
commit 141b8c2cd8

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