示例#1
0
文件: User.php 项目: h1soft/h1cms
 public function index()
 {
     $data['system_manager'] = true;
     $email = $this->request->get('email');
     $pagination = new Paginator($this->request->get('page'), 20, $this->request->data());
     $query = DB::table('users as u')->select("u.*,ug.group_name")->leftJoin('usergroups as ug', 'u.group_id=ug.group_id')->limit($pagination->getLimit(), $pagination->getOffset());
     if (Str::isEmail($email)) {
         $query->where('email', $email);
     }
     $data['users'] = $query->get(\PDO::FETCH_OBJ);
     $data['pagination'] = $pagination->makeHtml(5);
     return View::make('admin/system/user-index', $data);
 }
示例#2
0
文件: Group.php 项目: h1soft/h1cms
 public function index()
 {
     $data['system_manager'] = true;
     $group_name = $this->request->get('group_name');
     $pagination = new Paginator($this->request->get('page'), 20, $this->request->query->all());
     $query = DB::table('usergroups')->limit($pagination->getLimit(), $pagination->getOffset())->orderBy('created_at DESC');
     if (!empty($group_name)) {
         $query->where('group_name', $group_name);
     }
     $data['groups'] = $query->get(\PDO::FETCH_OBJ);
     $data['pagination'] = $pagination->makeHtml(5);
     $data['jsvars'] = array('token' => Security::getToken());
     return View::make('admin/system/group-index', $data);
 }