当前位置: 首页>>代码示例>>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;未经允许,请勿转载。