本文整理汇总了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();
}
}
示例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);
}
示例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]);
}
示例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);
}
示例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']);
}