Exemple #1
0
 public function __construct(Request $request)
 {
     parent::__construct($request);
     $this->params = $this->request->param();
     //$this->params = $_GET;
     $this->params = array_filter($this->params, 'strlen');
     $this->all_brand_pinyin = SEO::getBrandPinyin();
     $this->all_series_pinyin = SEO::getSeriesPinyin();
     if (!empty($this->params['brand_pinyin'])) {
         $all_brand_pinyin = array_flip($this->all_brand_pinyin);
         if (isset($all_brand_pinyin[$this->params['brand_pinyin']])) {
             $this->params['brand_id'] = $all_brand_pinyin[$this->params['brand_pinyin']];
         }
     }
     if (!empty($this->params['series_pinyin'])) {
         $all_series_pinyin = array_flip($this->all_series_pinyin);
         if (isset($all_series_pinyin[$this->params['series_pinyin']])) {
             $this->params['series_id'] = $all_series_pinyin[$this->params['series_pinyin']];
         }
     }
     $allowed = array('city_pinyin', 'brand_id', 'series_id', 'brand_pinyin', 'series_pinyin', 'price_f', 'price_t', 'mile', 'mile_f', 'mile_t', 'year_f', 'year_t', 'sort_f', 'sort_d', 'format');
     $this->_filter_array = array_intersect_key($this->params, array_flip($allowed));
 }