diff --git a/application/common/Model/TaskStages.php b/application/common/Model/TaskStages.php index b8f2e35..379e120 100644 --- a/application/common/Model/TaskStages.php +++ b/application/common/Model/TaskStages.php @@ -34,7 +34,7 @@ class TaskStages extends CommonModel * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ - public function tasks($stageCode, $deleted = 0, $done = -1, $title = '', $pri = [], $executor = [], $creator = [], $joiner = [], $endTime = [], $beginTime = [], $createTime = [], $doneTime = []) + public function tasks($stageCode, $deleted = 0, $done = -1, $title = '', $pri = [], $executor = [], $creator = [], $joiner = [], $status = [], $endTime = [], $beginTime = [], $createTime = [], $doneTime = []) { $where = ['pcode' => '', 'deleted' => $deleted]; if ($done != -1) { @@ -43,7 +43,7 @@ class TaskStages extends CommonModel $taskModel = Task::alias('t')->where($where); if (is_array($stageCode)) { $taskModel = $taskModel->whereIn('t.stage_code', $stageCode); - }else{ + } else { $taskModel = $taskModel->where('t.stage_code', $stageCode); } if ($title) { @@ -52,6 +52,9 @@ class TaskStages extends CommonModel if ($pri) { $taskModel = $taskModel->whereIn('t.pri', $pri); } + if ($status) { + $taskModel = $taskModel->whereIn('t.status', $status); + } if ($endTime) { $taskModel = $taskModel->whereBetween('t.end_time', implode(',', $endTime)); } @@ -62,7 +65,7 @@ class TaskStages extends CommonModel $taskModel = $taskModel->whereBetween('t.create_time', implode(',', $createTime)); } if ($doneTime) { - $taskModel = $taskModel->leftJoin('project_log pl', 't.code = pl.source_code')->where(['pl.action_type'=> 'task', 'pl.type' => 'done'])->whereBetween('pl.create_time', $doneTime); + $taskModel = $taskModel->leftJoin('project_log pl', 't.code = pl.source_code')->where(['pl.action_type' => 'task', 'pl.type' => 'done'])->whereBetween('pl.create_time', $doneTime); } //todo 查询范围问题 $joinTaskMember = false; diff --git a/application/project/controller/TaskStages.php b/application/project/controller/TaskStages.php index 7d5cecf..2db7a27 100644 --- a/application/project/controller/TaskStages.php +++ b/application/project/controller/TaskStages.php @@ -69,6 +69,7 @@ class TaskStages extends BasicApi $done = Request::param('done', -1); $title = Request::param('title', ''); $pri = json_decode(Request::post('pri', '')); + $status = json_decode(Request::post('status', '')); $stage = json_decode(Request::post('stage', '')); $executor = json_decode(Request::post('executor', '')); $creator = json_decode(Request::post('creator', '')); @@ -81,7 +82,7 @@ class TaskStages extends BasicApi $this->error("数据解析异常"); } $where[] = ['stage_code', '=', $code]; - $list = $this->model->tasks($code, 0, $done, $title, $pri, $executor, $creator, $joiner, $endTime, $beginTime, $createTime, $doneTime); + $list = $this->model->tasks($code, 0, $done, $title, $pri, $executor, $creator, $joiner, $status, $endTime, $beginTime, $createTime, $doneTime); // $list = \app\common\Model\Task::alias('t')->join('member m','t.assign_to = m.code')->field()->where(['stage_code'=>$code])->select(); $this->success('', $list);