/**
  * Filter For LowerHouse
  * @param  Illuminate\Http\Request $request
  * @return LengthAwarePaginator
  */
 protected function filter($request)
 {
     if ($st_name = $request->input('st_name')) {
         $this->model = $this->model->like('properties.ST', $st_name);
     }
     if ($dt_name = $request->input('dt_name')) {
         $this->model = $this->model->like('properties.DT', $dt_name);
     }
     if ($ts_name = $request->input('ts_name')) {
         $this->model = $this->model->like('properties.TS', $ts_name);
     }
     if ($object_id = $request->input('object_id')) {
         $this->model = $this->model->where('properties.OBJECTID', (int) $object_id);
     }
     if ($st_pcode = $request->input('st_pcode')) {
         $this->model = $this->model->where('properties.ST_PCODE', $st_pcode);
     }
     if ($dt_pcode = $request->input('dt_pcode')) {
         $this->model = $this->model->where('properties.DT_PCODE', $dt_pcode);
     }
     if ($ts_pcode = $request->input('ts_pcode')) {
         $this->model = $this->model->where('properties.TS_PCODE', $ts_pcode);
     }
     if ($by_party = $request->input('by_party')) {
         $this->model = $this->model->where('properties.Summary', strtoupper($by_party));
     }
     if ($noGeo = $request->input('no_geo')) {
         if ($noGeo == 'true') {
             return $this->model->paginate(['type', 'properties']);
         }
     }
     return $this->model->paginate();
 }
 /**
  * Filter For UpperHouse
  * @param  Illuminate\Http\Request $request
  * @return LengthAwarePaginator
  */
 protected function filter($request)
 {
     if ($st_name = $request->input('st_name')) {
         $this->model = $this->model->like('properties.ST', $st_name);
     }
     if ($st_pcode = $request->input('st_pcode')) {
         $this->model = $this->model->where('properties.ST_PCODE', $st_pcode);
     }
     if ($noGeo = $request->input('no_geo')) {
         if ($noGeo == 'true') {
             return $this->model->paginate(['type', 'properties']);
         }
     }
     return $this->model->paginate();
 }
Exemplo n.º 3
0
 /**
  * Filter For FAQ
  * @param  Illuminate\Http\Request $request
  * @return LengthAwarePaginator
  */
 protected function filter($request)
 {
     if ($type = $request->input('type')) {
         switch ($type) {
             case 'yes_no':
                 $type = 'Yes/No';
                 break;
             case 'open_ended':
                 $type = 'Open-ended';
                 break;
         }
         $this->model = $this->model->where('question_type', $type);
     }
     if ($section = $request->input('section')) {
         $this->model = $this->model->like('article_or_section', $section);
     }
     if ($category = $request->input('category')) {
         $this->model = $this->model->like('question_category', $category);
     }
     if ($law = $request->input('source')) {
         $this->model = $this->model->like('law_or_source', $law);
     }
     return $this->model->paginate();
 }