Merge pull request '管理员可看所有任务' (#184) from preview into master
Reviewed-on: #184
This commit is contained in:
commit
b92e51c2e2
@ -28,30 +28,34 @@ class TaskController extends BaseApiController
|
||||
$time = strtotime(date('Y-m-d'));
|
||||
$userCompanyInfo = Company::where('id', $this->userInfo['company_id'])->find();
|
||||
$where = [];
|
||||
|
||||
if ($userCompanyInfo['company_type'] == 18) {
|
||||
$is_captain = User::where('id', $this->userId)->value('is_captain');
|
||||
if ($is_captain == 1) {
|
||||
$where[] = ['type', 'in', [31,33]];
|
||||
}
|
||||
// 公司负责人直接看公司的全部任务
|
||||
if ($this->userInfo['admin_id'] != 0) {
|
||||
$where[] = ['company_id', '=', $this->userInfo['company_id']];
|
||||
} else {
|
||||
// 其他角色看个人的任务
|
||||
if ($userCompanyInfo['company_type'] == 18) {
|
||||
$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']];
|
||||
$where[] = ['company_id', '=', $this->userInfo['company_id']];
|
||||
}
|
||||
|
||||
if ($userCompanyInfo['company_type'] == 16) {
|
||||
$where[] = ['director_uid', '=', $this->userId];
|
||||
// $where[] = ['company_id', '=', $this->userInfo['company_id']];
|
||||
}
|
||||
if ($userCompanyInfo['company_type'] == 17) {
|
||||
$where[] = ['director_uid', '=', $this->userId];
|
||||
// $where[] = ['company_id', '=', $this->userInfo['company_id']];
|
||||
}
|
||||
}
|
||||
|
||||
if ($userCompanyInfo['company_type'] == 16) {
|
||||
$where[] = ['director_uid', '=', $this->userId];
|
||||
// $where[] = ['company_id', '=', $this->userInfo['company_id']];
|
||||
}
|
||||
if ($userCompanyInfo['company_type'] == 17) {
|
||||
$where[] = ['director_uid', '=', $this->userId];
|
||||
// $where[] = ['company_id', '=', $this->userInfo['company_id']];
|
||||
}
|
||||
if ($this->userInfo['admin_id'] != 0) {
|
||||
$where = ['company_id', '=', $this->userInfo['company_id']];
|
||||
}
|
||||
|
||||
if (isset($param['date_time']) && $param['date_time'] != '') {
|
||||
$time = strtotime($param['date_time']);
|
||||
$param['start_time']=date('Y-m-d H:i:s',$time);
|
||||
|
Loading…
x
Reference in New Issue
Block a user