Пример #1
0
 public function index()
 {
     $condition = "";
     $param = array();
     $search = $this->g('search');
     if (!empty($search)) {
         $condition = " user_account LIKE :user_account OR user_mail LIKE :user_mail OR user_name LIKE :user_name ";
         $param['user_account'] = "%{$search}%";
         $param['user_mail'] = "%{$search}%";
         $param['user_name'] = "%{$search}%";
     }
     $page = new \Expand\Team\Page();
     $total = count($this->db('user')->where($condition)->select($param));
     $count = $page->total($total);
     $page->handle();
     $list = $this->db('user')->where($condition)->order("user_id desc")->limit("{$page->firstRow}, {$page->listRows}")->select($param);
     $show = $page->show();
     foreach (\Model\Content::listContent('department') as $key => $value) {
         $findDepartment[$value['department_id']] = $value['department_name'];
     }
     $this->assign('findDepartment', $findDepartment);
     $this->assign('page', $show);
     $this->assign('list', $list);
     $this->assign('title', \Model\Menu::getTitleWithMenu());
     $this->layout();
 }
Пример #2
0
 /**
  * 我的报表
  */
 public function my()
 {
     $page = new \Expand\Team\Page();
     $total = count(\Model\Content::listContent('report', array('user_id' => $_SESSION['team']['user_id']), 'user_id = :user_id'));
     $count = $page->total($total);
     $page->handle();
     $list = \Model\Content::listContent('report', array('user_id' => $_SESSION['team']['user_id']), 'user_id = :user_id', 'report_id DESC', "{$page->firstRow}, {$page->listRows}");
     $show = $page->show();
     $this->assign('page', $show);
     $this->assign('list', $list);
     $this->assign('title', \Model\Menu::getTitleWithMenu());
     $this->layout('Report_index');
 }
Пример #3
0
 /**
  * 内容列表
  */
 public function index()
 {
     $page = new \Expand\Team\Page();
     $total = count($this->db($this->table)->select());
     $count = $page->total($total);
     $page->handle();
     $list = $this->db($this->table)->order("{$this->fieldPrefix}listsort asc, {$this->fieldPrefix}id desc")->limit("{$page->firstRow}, {$page->listRows}")->select();
     $show = $page->show();
     $this->assign('page', $show);
     $this->assign('list', $list);
     $this->assign('title', $this->model['lang_key']);
     $this->layout(is_file(THEME . '/' . GROUP . "/{$this->theme['value']}/" . MODULE . "_index.php") ? MODULE . "_index" : 'Content_index');
 }
Пример #4
0
 /**
  * 全体动态
  */
 public function dynamic()
 {
     $page = new \Expand\Team\Page();
     $page->listRows = "30";
     $total = count($this->db('dynamic AS d')->field('d.dynamic_id')->join("{$this->prefix}task AS t ON t.task_id = d.task_id")->order('dynamic_id DESC')->group('d.dynamic_id')->select());
     $count = $page->total($total);
     $page->handle();
     $list = $this->db('dynamic AS d')->join("{$this->prefix}task AS t ON t.task_id = d.task_id")->order('dynamic_id DESC')->group('d.dynamic_id')->limit("{$page->firstRow}, {$page->listRows}")->select();
     $show = $page->show();
     $this->assign('page', $show);
     $this->assign('list', $list);
     //获取更新信息
     $updateTips = $this->db('update_list')->where('update_list_read = 0')->order('update_list_type DESC')->find();
     $this->assign('updateTips', $updateTips);
     $this->assign('title', \Model\Menu::getTitleWithMenu());
     //每天下午3点开始10分钟将自动检测更新
     if (date('hi') >= '1500' && date('hi') <= '1510') {
         $update = \Model\Option::getUpdate();
         if ($update['status'] == '-1') {
             $this->assign('noCurl', '1');
         }
     }
     $this->layout();
 }
Пример #5
0
 /**
  * 待我审核/指派的任务
  */
 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');
 }