diff --git a/application/common/Model/TaskStages.php b/application/common/Model/TaskStages.php index f093d6c..61855d9 100755 --- a/application/common/Model/TaskStages.php +++ b/application/common/Model/TaskStages.php @@ -46,8 +46,15 @@ class TaskStages extends CommonModel if (is_array($stageCode)) { $taskModel = $taskModel->whereIn('t.stage_code', $stageCode); } else { - if (isset($data['type']) && $data['type'] != 'all') + if (isset($data['type']) && $data['type'] != 'all'){ $taskModel = $taskModel->where('t.stage_code', $stageCode); + }elseif(isset($data['type']) && $data['type'] == 'all'){ + if(isset($data['type_name'])){ + $code =Db::name('task_stages')->where('name',$data['type_name'])->where('deleted',0)->column('code'); + $taskModel = $taskModel->whereIn('t.stage_code', $code); + } + + } } if ($title) { $taskModel = $taskModel->whereLike('t.name', "%$title%"); diff --git a/application/project/controller/TaskStages.php b/application/project/controller/TaskStages.php index 5b43e36..f30a1d3 100755 --- a/application/project/controller/TaskStages.php +++ b/application/project/controller/TaskStages.php @@ -67,6 +67,7 @@ class TaskStages extends BasicApi $where = []; $code = Request::post('stageCode'); $type = Request::post('type'); + $type_name = Request::post('type_name'); $page = Request::post('page',1); $done = Request::param('done', -1); $title = Request::param('title', ''); @@ -85,7 +86,8 @@ class TaskStages extends BasicApi } $where[] = ['stage_code', '=', $code]; $data = ['type'=>$type]; - $data = ['page'=>$page]; + $data['page'] = $page; + $data['type_name'] = $type_name; $list = $this->model->tasks($code, 0, $done, $title, $pri, $executor, $creator, $joiner, $status, $endTime, $beginTime, $createTime, $doneTime,$data); // $list = \app\common\Model\Task::alias('t')->join('member m','t.assign_to = m.code')->field()->where(['stage_code'=>$code])->select();