예제 #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 edit($id)
 {
     if (!$id) {
         return Redirect::action('system/group')->with('error', '用户组不存在');
     }
     $group = DB::table('usergroups')->where('group_id', $id)->first();
     if (empty($group)) {
         return Redirect::action('system/group')->with('error', '用户组不存在');
     }
     $view = View::make('admin/system/group-edit');
     $view->system_manager = true;
     $view->group = $group;
     $view->token = Security::getToken($id);
     $view->id = $id;
     return $view;
 }
예제 #3
0
파일: User.php 프로젝트: h1soft/h1cms
 public static function findByEmail($email)
 {
     return DB::table('users')->where('email', $email)->first(\PDO::FETCH_OBJ);
 }