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


PHP District::select方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $districts['results'] = District::select('id', 'name as text')->get()->toArray();
     foreach ($districts['results'] as $key => $value) {
         if ($value['children'] == null) {
             unset($districts['results'][$key]);
         }
     }
     $districts['results'] = array_values(array_filter($districts['results']));
     return Response::json($districts);
 }
开发者ID:mertindervish,项目名称:registerbg,代码行数:16,代码来源:ApiDistrictController.php

示例2: listFilters

 public static function listFilters()
 {
     $filters_data['all'] = array(array('name' => 'Вид', 'list' => Type::select('id', 'name')->get()->toArray()), array('name' => 'Финансиране', 'list' => Financing::select('id', 'name')->get()->toArray()), array('name' => 'Специалности', 'list' => Specialty::select('id', 'name')->get()->toArray()));
     if (Input::has('district') == false && Input::has('municipality') == false && Input::has('city') == false) {
         $filters_data['all'][] = array('name' => 'Област', 'list' => District::select('id', 'name')->get()->toArray());
     }
     if (Input::has('district') == true && Input::has('municipality') == false && Input::has('city') == false) {
         $district = Input::get('district');
         if (is_array(Input::get('district'))) {
             $district = end($district);
         }
         $filters_data['all'][] = array('name' => 'Община', 'previous' => 'Област', 'list' => Municipality::select('id', 'name')->where('district_id', '=', $district)->get()->toArray());
         $filters_data['previous_location'] = URL::route('schools.index', Input::except('district', 'municipality', 'city'));
     }
     if (Input::has('district') == true && Input::has('municipality') == true || Input::has('municipality') == true || Input::has('city') == true) {
         $municipality = Input::get('municipality');
         if (is_array(Input::get('municipality'))) {
             $municipality = end($municipality);
         }
         $filters_data['all'][] = array('name' => 'Град/село', 'previous' => 'Община', 'list' => City::select('id', 'name')->where('municipality_id', '=', $municipality)->get()->toArray());
         $filters_data['previous_location'] = URL::route('schools.index', Input::except('municipality', 'city'));
     }
     $input_filter = array_filter(Input::only('city', 'district', 'financing', 'municipality', 'specialty', 'type'));
     if (!empty($input_filter)) {
         $filters_data['clean_all_filters'] = URL::route('schools.index', array_filter(Input::only('search')));
     }
     return $filters_data;
 }
开发者ID:mertindervish,项目名称:registerbg,代码行数:28,代码来源:School.php


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