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


PHP User::search方法代码示例

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


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

示例1: index

 public function index(Request $request)
 {
     $request->get('password');
     $users = User::search($request->get('search'))->orderBy('id', 'DESC')->paginate(3);
     $users->setPath('users');
     return view('users.index', compact('users'));
 }
开发者ID:jdiaz1989,项目名称:intranet,代码行数:7,代码来源:UsersController.php

示例2: search

 public function search(Request $request)
 {
     $query = $request->get('query');
     $products = Product::search($query)->get();
     $users = User::search($query)->get();
     return view('backend.search', compact('products', 'users'));
 }
开发者ID:mmonbr,项目名称:20Pavos,代码行数:7,代码来源:BackendController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     if ($request->has('q')) {
         $q = $request->input('q');
         return view('backend.users.inde')->withUsers(User::search($q)->paginate(5));
     }
     return view('backend.users.inde')->withUsers(User::paginate(5));
 }
开发者ID:soarmorrow,项目名称:grabage-collector,代码行数:13,代码来源:UsersController.php

示例4: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $index = $this->algolia->initIndex('users');
     //        $results = $index->search($request->get('query'))['hits'];
     $results = User::search($request->get('query'));
     //        dd($results);
     return view('search.results', compact('results'));
 }
开发者ID:WebsterFolksLabs,项目名称:laramap.com,代码行数:14,代码来源:SearchController.php

示例5: users

 public function users()
 {
     $query = session('query');
     if (!User::typeExists()) {
         User::addAllToIndex();
     }
     $users = User::search($query);
     return view('search', compact('users'));
 }
开发者ID:moreno93,项目名称:ria_projekt,代码行数:9,代码来源:SearchController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $request->flash();
     $users = User::search($request);
     // $roles = Role::where('id', '>', 2)->first();
     // if(!empty($roles)){
     //     $users = $roles->users()->get();
     // }
     $roles = Role::orderBy('name')->lists('name', 'id');
     return view('store_user.index', compact('users', 'roles'));
 }
开发者ID:renciebautista,项目名称:pcount2,代码行数:16,代码来源:StoreUserController.php

示例7: searchUsersURL

 /**
  * Search users by url
  *
  * @param $keyword
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function searchUsersURL($keyword)
 {
     $users = User::search($keyword);
     return view('manage.user.index', compact('users', 'keyword'));
 }
开发者ID:CaliProject,项目名称:mikenong-dev,代码行数:11,代码来源:ManageController.php

示例8: search

 /**
  * Display a searched listing of users.
  *
  * @param  App\Modules\Users\Http\Requests\SearchRequest  $request
  * @return Response
  */
 public function search(SearchRequest $request)
 {
     $query = $request->input('query');
     $users = User::search($query)->get();
     return view('users::search', compact('users'));
 }
开发者ID:cloud5ideas,项目名称:appkit,代码行数:12,代码来源:UsersController.php

示例9: search

 public function search(Request $request)
 {
     $users = User::search($request['query'])->get();
     $type = 'search';
     return view('admin.user.index', compact('users', 'type'));
 }
开发者ID:MangTomas23,项目名称:cnhs-portal,代码行数:6,代码来源:AdminController.php

示例10: fastSearch

 public function fastSearch(Request $request)
 {
     $this->validate($request, ['query' => 'required|min:3', 'section' => 'required|in:users,products']);
     if ($request->input('section') == 'users') {
         $query = User::search($request->input('query'), null, true);
         $query->leftJoin('profits', 'users.id', '=', 'profits.user_id');
         $query = $query->select(DB::raw("IF(profits.created_at>'" . Carbon::now()->subWeek() . "','yes','no') AS test,IFNULL(`profits`.`type`,0) AS type,(SELECT relevance)*(case when type=1 AND (SELECT test)='yes' then  '" . Config::get('addonProfit.attributes')[1]['values'][1]['weight'] . "' when type=2 AND (SELECT test)='yes' then '" . Config::get('addonProfit.attributes')[1]['values'][2]['weight'] . "' when type=3 AND (SELECT test)='yes' then '" . Config::get('addonProfit.attributes')[1]['values'][3]['weight'] . "' else 1 end) AS total_relevance"))->addSelect('users.*')->groupBy('users.id')->orderBy('total_relevance', 'DESC');
         $results = $query->get();
     } elseif ($request->input('section') == 'products') {
         $query = Product::search($request->input('query'), null, true);
         $results = $query->groupBy('products.id')->get();
     }
     $return = view('search.partials.fastResult', compact('results'))->with(['section' => $request->input('section')])->render();
     return ['hasCallback' => 1, 'callback' => 'search_fast', 'hasMsg' => 0, 'msg' => '', 'msgType' => '', 'returns' => $return];
 }
开发者ID:emadmrz,项目名称:Hawk,代码行数:15,代码来源:SearchController.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::search(Request::all())->paginate(50);
     return view('user.index')->with(compact('users'));
 }
开发者ID:avinaszh,项目名称:callcenter,代码行数:10,代码来源:UserController.php

示例12: index

 public function index(Request $request)
 {
     $users = User::search($request->name)->orderBy('id', 'DESC')->paginate(5);
     return view('admin.users.users')->with('users', $users);
 }
开发者ID:gratereaux,项目名称:practicing-laravel,代码行数:5,代码来源:UsersController.php

示例13: filterUsers

 public function filterUsers(Request $request)
 {
     if ($request->ajax()) {
         return User::search($request->input('param'), null, true)->get();
     }
 }
开发者ID:amatelic,项目名称:skavti,代码行数:6,代码来源:UserController.php

示例14: searchUsers

 /**
  * Display a searched user list by given keywords
  *
  * @param $keywords
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function searchUsers($keywords)
 {
     $manage = true;
     $users = User::search($keywords);
     $title = count($users) ? $keywords . "的相关用户" : "无相关用户";
     return view('manage.users', compact('title', 'manage', 'users'));
 }
开发者ID:CaliCastle,项目名称:AbletiveVIPWebsite,代码行数:13,代码来源:ManageController.php


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