當前位置: 首頁>>代碼示例>>PHP>>正文


PHP User::all方法代碼示例

本文整理匯總了PHP中app\User::all方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::all方法的具體用法?PHP User::all怎麽用?PHP User::all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\User的用法示例。


在下文中一共展示了User::all方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: listAllUsers

 /**
  * Return all records/entities for users
  *
  * @return array
  */
 public function listAllUsers()
 {
     $listUsers = array();
     $users = $this->model->all();
     foreach ($users as $usr) {
         $listUsers[$usr->id] = $usr->firstname . ' ' . $usr->lastname;
     }
     return $listUsers;
 }
開發者ID:vnzacky,項目名稱:dog,代碼行數:14,代碼來源:EloquentUserRepository.php

示例2: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     // 提醒遲到用戶申辯
     foreach (User::all() as $user) {
         $dashboardController = new DashboardController();
         $overResult = $dashboardController->calculateOvertime($user, date('Y-m-d'), $dashboardController->isWorkday(time()));
         $lateResult = $dashboardController->calculateLatetime($user, $overResult['firstSignIn'], date('Y-m-d'), $dashboardController->isWorkday(time()), '09:30:00');
         $count = $user->complains()->where('startdate', date('Y-m-d'))->where('state', '')->where('type', 'late')->count();
         if ($lateResult['isLate'] && $count == 0) {
             $this->userData = $user;
             Mail::send('emails.late', ['username' => $this->userData->employee->name], function ($message) {
                 $message->from('hziflytek@126.com', '移動互聯簽到係統');
                 $message->to($this->userData->employee->email, $this->userData->employee->name);
                 $message->subject('【遲到提醒】');
             });
             // $this->info($user->employee->name.'遲到了');
         }
     }
     // 提醒管理員處理申訴
     $count = Complain::where('state', '')->count();
     if ($count != 0) {
         foreach (User::all() as $user) {
             if ($user->employee->admin) {
                 $this->userData = $user;
                 Mail::send('emails.admin', ['username' => $this->userData->employee->name], function ($message) {
                     $message->from('hziflytek@126.com', '移動互聯簽到係統');
                     $message->to($this->userData->employee->email, $this->userData->employee->name);
                     $message->subject('【審核提醒】');
                 });
                 // $this->info('提醒'.$user->employee->name);
             }
         }
     }
 }
開發者ID:imxseraph,項目名稱:sign-system,代碼行數:39,代碼來源:SendEmail.php

示例3: competition

 public function competition()
 {
     $users = User::all();
     $competitors = Competitor::all();
     $data = ['competitors' => $competitors];
     return View('competition.competition')->with($data);
 }
開發者ID:jeroenjvdb,項目名稱:web-development-p1-wedstrijd-v2,代碼行數:7,代碼來源:MainController.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int  
  * @return \Illuminate\Http\Response
  */
 public function show()
 {
     $user = User::all();
     $dog = Dog::all();
     //$dog = Dog::find(3);
     return view('users', ['users' => $user, 'dogs' => $dog]);
 }
開發者ID:jschouwstra,項目名稱:lrvl-foxi,代碼行數:13,代碼來源:UserController.php

示例5: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $users = User::all();
     foreach ($users as $user) {
         Artisan::call('api-key:generate', ['--user-id' => $user->id]);
     }
 }
開發者ID:WebsterFolksLabs,項目名稱:laramap.com,代碼行數:12,代碼來源:SetAPIKeys.php

示例6: store

 public function store(Request $r)
 {
     if (!User::all()->count()) {
         User::create(['name' => $r['name'], 'email' => $r['email'], 'password' => bcrypt($r['password'])]);
     }
     return redirect(url('/login'));
 }
開發者ID:edilsonribeiro,項目名稱:blog-laravelexpress,代碼行數:7,代碼來源:UserController.php

示例7: index

 public function index()
 {
     if (\Request::ajax()) {
         return User::all();
     }
     return view('user.index');
 }
開發者ID:Yuth-Set,項目名稱:cms,代碼行數:7,代碼來源:UserController.php

示例8: index

 /**
  * Index page
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function index()
 {
     $productsCount = Product::all()->count();
     $categoriesCount = Category::all()->count();
     $usersCount = User::all()->count();
     return view('manage.index', compact('productsCount', 'categoriesCount', 'usersCount'));
 }
開發者ID:CaliProject,項目名稱:mikenong-dev,代碼行數:12,代碼來源:ManageController.php

示例9: handle

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $users = User::all();
     foreach ($users as $user) {
         $user->update_status();
     }
 }
開發者ID:hvs-fasya,項目名稱:seo_padawan,代碼行數:12,代碼來源:UpdateUsersStatus.php

示例10: getInfoById

 /**
  * Get user object by id
  *
  * @param $id
  *
  * @return null|stdClass
  */
 public static function getInfoById($id)
 {
     $users = User::all()->where('id', intval($id));
     if ($users->count() == 0) {
         return null;
     }
     $user = $users->first();
     $u = new stdClass();
     $u->id = $user->id;
     $u->name = $user->name;
     $u->lop = ClassX::getClassName($user->class);
     $u->email = $user->email;
     $u->type = $user->type;
     if ($u->type == 'teacher') {
         $u->avatar = '0';
     } else {
         $u->avatar = '1';
     }
     if ($u->type == 'student') {
         $u->mssv = $user->msv;
     } else {
         $u->mssv = '';
     }
     return $u;
 }
開發者ID:uethackathon02,項目名稱:uethackathon2015_team2server,代碼行數:32,代碼來源:User.php

示例11: getInvite

 public function getInvite($group)
 {
     $title = "Groups";
     $bodyclass = "app-groups";
     $users = \App\User::all();
     return view('site.groups.invite', compact('title', 'group', 'users', 'bodyclass'));
 }
開發者ID:strikles,項目名稱:php,代碼行數:7,代碼來源:GroupsController.php

示例12: home

 /**
  * Display a home page.
  *
  * @return Response
  */
 public function home()
 {
     $activeUsers = 3;
     $totalUsers = User::all()->count();
     $eventCount = Event::all()->count();
     return view('admin.home', compact('activeUsers', 'totalUsers', 'eventCount'));
 }
開發者ID:charlieboo,項目名稱:creatrip,代碼行數:12,代碼來源:HomeController.php

示例13: getAssigntarget

 public function getAssigntarget()
 {
     $employee = Employee::all();
     $categories = Event::all();
     $userdetails = User::all();
     $targets = Targetassign::all();
     $deals = Deal::all();
     $userData = array();
     $key = 0;
     foreach ($targets as $target) {
         $achieved = 0;
         $userData[$key]['eventcode'] = $target->Eventcode;
         $userData[$key]['event'] = $target->Eventname;
         $userData[$key]['employee'] = $target->Employeeid;
         $userData[$key]['targetVal'] = $target->Targetvalue;
         foreach ($deals as $deal) {
             if ($target->Eventcode == $deal->Eventcode && $target->Employeeid == $deal->Empid) {
                 $achieved = $achieved + $deal->Dealvalue;
             }
         }
         $userData[$key]['achieved'] = $achieved;
         $userData[$key]['variance'] = $achieved - $target->Targetvalue;
         $userData[$key]['cur'] = $target->Currency;
         $key++;
     }
     return View('approval/assigntarget')->with(array('categories' => $categories, 'employee' => $employee, 'userdata' => $userData, 'targets' => $targets, 'eventtable' => $categories));
 }
開發者ID:harshithanaiduk,項目名稱:iclock-newtheme,代碼行數:27,代碼來源:ApprovalController.php

示例14: is_active

 public function is_active($id)
 {
     $page = 'partials.admin-userManagement';
     $users = User::all();
     // Lấy hết tất cả các User có trong table users
     $manage_users = User::simplePaginate(8);
     // Phân trang
     $manage_users->setPath('');
     // Chỉnh đường dẫn URL
     // --------------- //
     $identifier = User::find($id);
     // Tìm user có ID như $id cho vào biến $identifier
     $user_order = Order::where('user_id', '=', $identifier->id)->first();
     ///////////////////////////////////////////////////////////
     // Câu điều kiện kiểm tra nếu người dùng có hóa đơn chưa //
     // thanh toán thì không cho người dùng đó ngưng hoạt động//
     ///////////////////////////////////////////////////////////
     if (count($user_order) == 0 || $user_order->status == 1) {
         if ($identifier->is_active == 1) {
             $identifier->is_active = 0;
         } else {
             $identifier->is_active = 1;
         }
         $identifier->save();
         return redirect()->route('admin.userManagement');
     } else {
         echo "<script>\n                    alert('This user havent paid his/her Order yet!');\n                    window.history.back();\n                 </script>";
     }
 }
開發者ID:ittamphan,項目名稱:EC_12110CLC_GroupF,代碼行數:29,代碼來源:UsersController.php

示例15: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $users = Cache::remember('users', 15, function () {
         return User::all();
     });
     return response()->json(['data' => $users], 200);
 }
開發者ID:wyrover,項目名稱:refund-api,代碼行數:12,代碼來源:UserController.php


注:本文中的app\User::all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。