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


PHP User::getUser方法代码示例

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


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

示例1: index

 /**
  * Displays the view for the Admin control panel.
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function index()
 {
     if (!$this->authorize('show-admin')) {
         redirect('home');
     }
     $data = ['page_title' => 'Admin Dashboard', 'users' => User::getUser(), 'num_users' => User::getNumOfUsers(), 'roles' => Role::all(), 'num_admins' => User::getNumAdmins(), 'centers' => Fund::all()];
     return view('admin.dashboard', $data);
 }
开发者ID:dericcain,项目名称:OrgHealthTC,代码行数:13,代码来源:AdminDashboardController.php

示例2: modifyuser

 public function modifyuser(Request $request)
 {
     $id = $request->get('id', null);
     $user_model = new User();
     $user = $user_model->getUser(['id' => $id]);
     $data = ['id' => $id, 'user' => $user];
     return view('ajax/admin/muser', $data)->renderSections();
 }
开发者ID:kits2code,项目名称:ignore,代码行数:8,代码来源:AdminAjaxController.php

示例3: create

 public function create($id)
 {
     //
     $model = new Article();
     $article = $model->getArticle(["id" => $id]);
     $usrlike = new UserLikeModel();
     $islike = $usrlike->islike(['Article_id' => $id, 'User_id' => \Session::get('id')]);
     $user_model = new User();
     if ($article) {
         $user = $user_model->getUser(['id' => $article->Users_id]);
     }
     return view("article.index", ["article" => $article, 'islike' => $islike, 'author' => $user]);
 }
开发者ID:kits2code,项目名称:ignore,代码行数:13,代码来源:ArticleController.php

示例4: create

 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function create()
 {
     //
     $usrlike = new UserLikeModel();
     $user_model = new User();
     if ($Uid = \Session::get('id')) {
         $user = $user_model->getUser(['id' => $Uid]);
         $attributes = ['User_id' => $Uid];
         $alllikes = $usrlike->getAll($attributes, ['Article_id']);
         $article_model = new Article();
         $articles = null;
         foreach ($alllikes as $Aid) {
             $articles[] = $article_model->getArticle(['id' => $Aid->Article_id]);
         }
     }
     return view("user.create", ['articles' => $articles, 'alllikes' => $alllikes, 'user' => $user]);
 }
开发者ID:kits2code,项目名称:ignore,代码行数:22,代码来源:UserController.php

示例5: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     //
     $user_like_model = new UserLikeModel();
     $article_model = new Article();
     $user_model = new User();
     $ids = $user_like_model->getAll(['User_id' => $id], ['Article_id']);
     $articles = [];
     $index = 0;
     foreach ($ids->items() as $item) {
         $tmp = $article_model->getArticle(['id' => $item->Article_id]);
         $articles[$index]['title'] = strip_tags($tmp->title);
         $articles[$index]['content'] = strip_tags($tmp->content);
         $articles[$index]['author'] = $user_model->getUser(['id' => $tmp->Users_id], ['name'])->name;
         $articles[$index]['created_at'] = $tmp->created_at;
         $articles[$index]['updated_at'] = $tmp->updated_at;
         ++$index;
     }
     $response = [];
     $response['s'] = '1';
     $response['msg'] = 'okay!';
     $response['articles'] = $articles;
     die(json_encode($response));
 }
开发者ID:kits2code,项目名称:ignore,代码行数:30,代码来源:PortalController.php

示例6: login

 /**
  * Function handles the login part
  * @param Request $request
  * @return string
  */
 public function login(Request $request)
 {
     header('Access-Control-Allow-Origin: *');
     $return = 'success';
     $user = new User();
     $email = $request->input('email');
     $password = $request->input('password');
     $loginUser = $user->getUser($email);
     if (strcmp($loginUser, 'failure') == 0) {
         $return = 'failure';
     } else {
         if ($user->checkPassword($loginUser, $password)) {
             $return = 'success';
         } else {
             $return = 'failure';
         }
     }
     if (strcmp($return, 'success') == 0) {
         $return = $user->getUser($email);
     }
     return $return;
 }
开发者ID:Usesthis-clone,项目名称:Backend,代码行数:27,代码来源:UserActionsController.php

示例7: getDashboard

 /**
  * Used to display the view of the main dashboard and also pass
  * along all of the variables and methods needed.
  *
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function getDashboard()
 {
     $data = ['page_title' => 'Dashboard', 'users' => User::getUser(), 'centers' => Fund::all(), 'num_centers_in_red' => Balance::getNumOfCentersInRed(), 'num_centers_in_black' => Balance::getNumOfCentersInRed(true), 'center_data' => Fund::getSeparateCenterAccounts()];
     return view('dashboard.dashboard', $data);
 }
开发者ID:dericcain,项目名称:OrgHealthTC,代码行数:11,代码来源:DashboardController.php

示例8: edit

 public function edit($id)
 {
     $data = ['user' => User::getUser($id), 'roles' => Role::all(), 'centers' => Center::all()];
     return view('user.edit-user', $data);
 }
开发者ID:dericcain,项目名称:OrgHealthTC,代码行数:5,代码来源:UserController.php


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