/** * 待我审核/指派的任务 */ public function check() { $condition = "t.task_delete = 0 AND tc.check_user_id = :check_user_id "; $param = array('check_user_id' => $_SESSION['team']['user_id']); $type = $this->g('type'); if ($type >= '0') { $condition .= " AND t.task_status = :task_status"; $param['task_status'] = $type; $order = "t.task_priority ASC, t.task_status ASC, t.task_id DESC"; } //搜索 if (!empty($_GET['search'])) { $condition .= " AND t.task_title LIKE :task_title"; $param['task_title'] = '%' . $this->g('search') . '%'; } //设置系统消息已读 switch ($type) { case '0': \Model\Notice::readNotice('2'); break; case '2': \Model\Notice::readNotice('3'); break; } //待指派的任务执行人ID为空且是当前用户部门的 if (!empty($_GET['user_type'])) { $condition .= " AND t.task_user_id = '' AND t.task_department_id = :task_department_id "; $param['task_department_id'] = $_SESSION['team']['user_department_id']; \Model\Notice::readNotice('5'); } $page = new \Expand\Team\Page(); $total = count($this->db('task AS t')->field("t.*")->join("{$this->prefix}task_check AS tc ON tc.task_id = t.task_id")->where($condition)->order($order)->group('t.task_id')->select($param)); $count = $page->total($total); $page->handle(); $list = $this->db('task AS t')->field("t.*")->join("{$this->prefix}task_check AS tc ON tc.task_id = t.task_id")->where($condition)->order($order)->group('t.task_id')->limit("{$page->firstRow}, {$page->listRows}")->select($param); $show = $page->show(); $this->assign('page', $show); $this->assign('list', $list); $this->assign('title', \Model\Menu::getTitleWithMenu()); $this->layout('Task_index'); }