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


PHP Search::create方法代碼示例

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


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

示例1: create

 function create()
 {
     $_S =& new AppSettings();
     if ($_S->isEnabled("enableUserSearch")) {
         parent::create();
     }
 }
開發者ID:alencarmo,項目名稱:OCF,代碼行數:7,代碼來源:usersearch.php

示例2: saved

 public function saved()
 {
     $input = Input::all();
     $sessionId = Common::checkSessionLogin($input);
     $inputSearch = ['name' => $input['name'], 'user_id' => $input['user_id'], 'price_id' => $input['price_id'], 'category_id' => $input['category_id'], 'type_id' => $input['type_id'], 'time_id' => $input['time_id'], 'city_id' => $input['city_id'], 'city' => Common::getModelField($input['city_id'], 'City', 'name'), 'lat' => $input['lat'], 'long' => $input['long']];
     Search::create($inputSearch);
     return Common::returnData(200, SUCCESS, $input['user_id'], $sessionId);
 }
開發者ID:trantung,項目名稱:online_market,代碼行數:8,代碼來源:ApiSearchController.php

示例3: run

 public function run()
 {
     Search::create(['label' => '阿登成人專場', 'count' => 12]);
     Search::create(['label' => '武輝成人專場', 'count' => 1434]);
     Search::create(['label' => '裕源成人專場', 'count' => 344]);
     Search::create(['label' => '壁鴻成人專場', 'count' => 112]);
     Search::create(['label' => '堅哥成人專場', 'count' => 888]);
     Search::create(['label' => '電影', 'count' => 88]);
     Search::create(['label' => '牛人', 'count' => 1188]);
     Search::create(['label' => '海賊王', 'count' => 17]);
     Search::create(['label' => '麵包', 'count' => 166]);
     Search::create(['label' => '牛奶', 'count' => 14]);
     Search::create(['label' => '咖啡', 'count' => 1]);
 }
開發者ID:Jv-Juven,項目名稱:gift,代碼行數:14,代碼來源:SearchTableSeeder.php

示例4: search

 public function search()
 {
     $search_term = Input::get('search_term');
     if (isset($search_term) && $search_term != '') {
         $search_query = '%' . $search_term . '%';
         $politicians = Politician::where('full_name', 'like', $search_query)->orWhere('party', 'like', $search_query)->orWhere('state', 'like', $search_query)->orWhere('city', 'like', $search_query)->orWhere('office', 'like', $search_query)->orWhere('sex', 'like', $search_query)->orWhere('bio', 'like', $search_query)->orWhere('district', 'like', $search_query)->get();
         if ($politicians->count() == 0) {
             $politicians = null;
         }
         $users = User::where('username', 'like', $search_query)->orWhere('first_name', 'like', $search_query)->orWhere('last_name', 'like', $search_query)->orWhere('email', 'like', $search_query)->orWhere('party', 'like', $search_query)->orWhere('state', 'like', $search_query)->orWhere('city', 'like', $search_query)->get();
         if ($users->count() == 0) {
             $users = null;
         }
         $issue = Issue::where('issue_name', '=', $search_term)->first();
         //don't want to repeat same articles in issue and in news.
         //don't want to do unnescesarry google news calls either
         //either news or issues
         if ($issue == null) {
             $news = $this->gNews($search_term);
         } else {
             $news = null;
         }
         $found = !($issue == null && $politicians == null && $news == null && $users == null);
         $user_id = Auth::check() ? Auth::user()->id : 0;
         //we're saving search attempts for study later. who searches and wether results are given.
         $search = Search::create(array('search_term' => $search_term, 'found' => $found, 'user_id' => $user_id));
         $search->save();
     } else {
         $politicians = null;
         $issue = null;
         $news = null;
         $users = null;
     }
     return View::make('results')->with('politicians', $politicians)->with('news', $news)->with('users', $users)->with('issue', $issue);
 }
開發者ID:netintelpro,項目名稱:laravel-app,代碼行數:35,代碼來源:HomeController.php

示例5: run

 public function run()
 {
     Search::create(['name' => 'Xe máy Yamaha', 'user_id' => '1', 'price_id' => '3', 'category_id' => '3', 'type_id' => '1', 'time_id' => '1', 'lat' => '21.00296184', 'long' => '105.85202157']);
     Search::create(['name' => 'Máy ảnh', 'user_id' => '1', 'price_id' => '2', 'category_id' => '5', 'type_id' => '1', 'time_id' => '1', 'lat' => '21.00296184', 'long' => '105.85202157']);
 }
開發者ID:trantung,項目名稱:online_market,代碼行數:5,代碼來源:SearchTableSeeder.php


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