Ejemplo n.º 1
0
 /**
  * Show vote ladder
  * GET
  *
  * @return Response
  */
 public function showVote()
 {
     $users = Cache::remember('ladderVote', 60, function () {
         return UserManager::orderBy('votes', 'desc')->take(config('config.ladder_limit'))->get();
     });
     return view('ladder.vote', compact('users'));
 }
Ejemplo n.º 2
0
 public function getSearch()
 {
     $builder = User::orderBy('updated_at');
     $pageSize = $this->request()->get('pageSize', 36);
     $sex = $this->request()->get('sex', UserEnum::SEX_FEMALE);
     $ageStart = $this->request()->get('age_start');
     $ageEnd = $this->request()->get('age_end');
     $wordkProvince = $this->request()->get('work_province');
     if ($sex) {
         $builder->where('sex', $sex);
     }
     if ($ageStart) {
         $birStart = ageToYear($ageStart);
         $builder->where('birthday', '<=', $birStart);
     }
     if ($ageEnd) {
         $birEnd = ageToYear($ageEnd);
         $builder->where('birthday', '>=', $birEnd);
     }
     if ($wordkProvince) {
         $builder->where('work_province', 'like', $wordkProvince);
     }
     $users = $builder->paginate($pageSize);
     $users->appends($this->request()->all());
     return $this->view('search')->with('users', $users);
 }
Ejemplo n.º 3
0
 public function index()
 {
     $where = $this->request()->all();
     $orderby = array_get($where, 'order', 'created_at');
     $sortby = array_get($where, 'sort', 'desc');
     \DB::enableQueryLog();
     $users = User::orderBy($orderby, $sortby);
     if (array_get($where, 'status')) {
         $users->status($where['status']);
     }
     if (array_get($where, 'level')) {
         $users->level($where['level']);
     }
     if (array_get($where, 'sex')) {
         $users->where('sex', $where['sex']);
     }
     if (array_get($where, 'age_start')) {
         $users->where('birthday', '<=', ageToYear($where['age_start']));
     }
     if (array_get($where, 'age_end')) {
         $users->where('birthday', '>=', ageToYear($where['age_end']));
     }
     if (array_get($where, 'keyword')) {
         $users->where(function ($query) use($where) {
             $keyword = '%' . $where['keyword'] . '%';
             $query->where('user_name', 'like', $keyword)->orWhere('mobile', 'like', $keyword)->orWhere('realname', 'like', $keyword)->orWhere('user_id', 'like', $keyword);
         });
     }
     $users = $users->with('likeMe')->paginate(array_get($where, 'size', 10));
     foreach ($where as $key => $query) {
         if ($key && $query) {
             $users->appends($key, $query);
         }
     }
     return $this->view('index')->with('users', $users);
 }
Ejemplo n.º 4
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     return backendView('index', array('users' => User::orderBy('id', 'DESC')->paginate(10)));
 }
Ejemplo n.º 5
0
 /**
  * Hiển thị danh sách các tài khoản
  *
  * @return Response
  */
 public function users()
 {
     /**
      * Kiểm tra TK đăng nhập nếu là Admin show ra tất cả các thành viên
      * Còn lại chỉ show TT TK đang đăng nhập
      */
     $page_title = 'Quản lý thành viên';
     if (Auth::user()->role == 1) {
         $users = User::orderBy('id')->paginate(5);
     } else {
         $users = User::where('id', Auth::user()->id)->paginate(5);
     }
     return view('auth.user.user_manager', ['users' => $users, 'page_title' => $page_title]);
 }
Ejemplo n.º 6
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $users = User::orderBy('corp')->get();
     return view('user.index', ['users' => $users]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $users = User::orderBy('name')->get();
     return view('user.list')->with('users', $users);
 }
Ejemplo n.º 8
0
 public function index(Request $request)
 {
     if ($request->input('username')) {
         return redirect('users/' . $request->input('username'));
     }
     $this->view->title = 'Users';
     $this->view->breadcrumbs = ['users' => 'Users'];
     $this->view->email_queue_count = \App\Model\QueuedEmail::count();
     $this->view->roles = Role::orderBy('name', 'ASC')->get();
     $this->view->users = User::orderBy('name', 'ASC')->paginate(20);
     $start = new \DateTime('today');
     $end = new \DateTime('1 month');
     $this->view->dates = new \DatePeriod($start, new \DateInterval('P1D'), $end);
     $this->view->day_count = iterator_count($this->view->dates);
     return $this->view;
 }