本文整理汇总了PHP中Region::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Region::where方法的具体用法?PHP Region::where怎么用?PHP Region::where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Region
的用法示例。
在下文中一共展示了Region::where方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRegions
public static function getRegions($continentString)
{
$regions = Region::where('continent', '=', $continentString)->get();
return $regions;
}
示例2: getRegion
/**
* 获取区域信息
*
* @return Response
*/
public function getRegion($regionID, $regionLevel)
{
$shopRegions = Region::where('wy_region_parentid', $regionID)->where('wy_region_level', $regionLevel)->get(array('wy_region_id', 'wy_region_name', 'wy_region_parentid', 'wy_region_shortname'));
if (empty($shopRegions->toArray())) {
return View::make('admin.manage.shop.shopregion')->withError(Lang::get('errormessages.-10041'));
} else {
return View::make('admin.manage.shop.shopregion', compact('shopRegions'));
}
}
示例3: listRegionsOneNation
/**
* @param $nation_id
* @return mixed
*/
public static function listRegionsOneNation($nation_id)
{
return Region::where('nation_id', '=', $nation_id)->lists('libelle', 'id');
}
示例4: function
<?php
Route::group(['prefix' => 'ajax'], function () {
# SelectBox Nations
Route::post('sbNations', function () {
$results = Nation::all();
$code = '';
foreach ($results as $result) {
$code .= '<option value="' . $result->id . '">' . $result->libelle . '</option>';
}
return $code;
});
# SelectBox Regions
Route::post('sbRegions/{nation_id}', function ($nation_id) {
$results = Region::where('nation_id', '=', $nation_id)->get();
$code = '';
foreach ($results as $result) {
$code .= '<option value="' . $result->id . '">' . $result->libelle . '</option>';
}
return $code;
});
# SelectBox Clubs
Route::post('sbClubs/{region_id}', function ($region_id) {
$results = Club::where('region_id', '=', $region_id)->get();
$code = '';
foreach ($results as $result) {
$code .= '<option value="' . $result->id . '">' . $result->nom . '</option>';
}
return $code;
});
# LoadPage
示例5: getRegions
/**
* AJAX response for autocomplete of regions.
*/
public function getRegions()
{
$matches = array();
$regions = Region::where('regionName', 'LIKE', '%' . Input::get('term') . '%')->get();
foreach ($regions as $region) {
$matches[] = '{"label":"' . $region->regionName . '","value":"' . $region->regionID . '"}';
}
echo '[' . implode(',', $matches) . ']';
}