本文整理匯總了PHP中app\models\City::select方法的典型用法代碼示例。如果您正苦於以下問題:PHP City::select方法的具體用法?PHP City::select怎麽用?PHP City::select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\models\City
的用法示例。
在下文中一共展示了City::select方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: store
/**
* Display setting store page
*
* @return response
*/
public function store()
{
$cities = select(City::select('id', 'name')->get());
$districts = ['' => _t('select_district')];
$wards = ['' => _t('select_ward')];
$categories = select(Category::select('id', 'name')->get());
$store = store();
if (user()->store !== null) {
$districts += select($this->_getDistrictsByCityId($store->city_id)->keyBy('id'));
$wards += select($this->_getWardsByCityId($store->district_id)->keyBy('id'));
}
return view('frontend::setting.store', ['categories' => ['' => _t('select_category')] + $categories, 'cities' => ['' => _t('select_city')] + $cities, 'districts' => $districts, 'wards' => $wards, 'store' => $store]);
}