当前位置: 首页>>代码示例>>PHP>>正文


PHP User::select方法代码示例

本文整理汇总了PHP中App\Model\User::select方法的典型用法代码示例。如果您正苦于以下问题:PHP User::select方法的具体用法?PHP User::select怎么用?PHP User::select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在App\Model\User的用法示例。


在下文中一共展示了User::select方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAllUser

 /**
  * Get all user
  * @return mixed
  */
 public function getAllUser()
 {
     $users = User::select('id', 'name', 'email')->get();
     $users = $users->reject(function ($user) {
         return $user->hasRole('admin') === true;
     });
     return $users;
 }
开发者ID:haster312,项目名称:laravel_rikkei,代码行数:12,代码来源:UserBusiness.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(DatabaseManager $db, Request $request)
 {
     $users = User::select('u_id', 'u_name', 'e-mail', 'location', 'skype', 'int_phone', 'desks.id as desk', 'departmants.job', 'departmants.dep', 'departmants.users as dep_users', 'rights.users as rights')->leftJoin('desks', 'users_id', '=', 'u_id')->leftJoin('rights', 'user_id', '=', 'u_id')->join('departmants', 'departmants.id', '=', 'departmant_id')->where('departmant_id', '!=', 21)->get()->keyBy('u_id')->toArray();
     $host = getenv('COMPUTERNAME');
     if (!in_array($host, ['SOFWKS0188', 'SOFWKS0159', 'SOFWKS0140'])) {
         $host = explode('.', gethostbyaddr($request->server->get('REMOTE_ADDR')));
         $host = $host[0];
     }
     $res = $db->table('computers')->select('user_id')->where('name', '=', $host)->first();
     if ($res) {
         $users[$res->user_id]['current'] = true;
         $users[$res->user_id]['edit'] = $this->checkUser($users[$res->user_id]);
     }
     // Apply data restrictions
     if (empty($res) || !$users[$res->user_id]['edit']) {
         $users = $this->filterRestrictedData($users);
     }
     $users = array_merge($users, $this->getSpecialUsers());
     return response()->json($users);
 }
开发者ID:angeli,项目名称:people,代码行数:25,代码来源:UserController.php

示例3: getPowerById

 public function getPowerById($id)
 {
     return User::select('power')->where('id', $id)->take(1)->get()[0]['power'];
 }
开发者ID:haiquang9994,项目名称:sifoni_haiquang9994_,代码行数:4,代码来源:User.php

示例4: BB

 public function BB()
 {
     return \Bin\View\View::make('index.php')->with('a', User::select('select * from test', 'data'));
 }
开发者ID:zhaozhenxiang,项目名称:-First,代码行数:4,代码来源:AA.php

示例5: checkUniqueEmail

 /**
  * Check that a users email is unique.
  *
  * @param int $user_id The users id.
  * @param string $email The email address.
  *
  * @return int `0` for not in use, `1` for in use
  */
 public function checkUniqueEmail($user_id, $email)
 {
     return $this->User->select('id')->where('email=? AND id<>?', array($email, $user_id))->limit(1)->data()->rowCount();
 }
开发者ID:discophp,项目名称:project,代码行数:12,代码来源:User.php


注:本文中的App\Model\User::select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。