예제 #1
0
 /**
  * Creates an array representation (Map) of the Query String parameters present.
  *
  * @return array
  */
 public function getValues()
 {
     $qs = Request::getQueryString();
     $result = [];
     // if we don't have any params at all
     if (strpos($qs, '=') === FALSE) {
         return $result;
     }
     // if we have multiple params set
     if (strpos($qs, '&') !== FALSE) {
         foreach (explode('&', $qs) as $segment) {
             $result[] = $this->splitSegment($segment);
         }
         return $result;
     }
     // if we only have one set
     return [$this->splitSegment($qs)];
 }
예제 #2
0
 public function category()
 {
     //列表
     $para = Request::getQueryString();
     $shops = $this->shop->getGoods($this->shop, $para, '', 'copy');
     //推荐的前三个
     $filter = [['recomment', '=', 1], ['num', '=', 1], ['status', '=', 1]];
     $fields = ['id', 'title', 'category_id', 'price', 'thumb'];
     $order = [['sorts', 'asc'], ['updated_at', 'desc']];
     $shops['recomment_lists'] = $this->shop->getShopList($this->shop, $filter, $fields, $order, 0, 3, 0);
     //分类
     $shops['categories'] = $this->categories;
     //当前分类
     $shops['category'] = $this->category->find(Request::get('b'))->name;
     //价格区间
     $shops['price'] = Config::get("shop::copy.price");
     //交易方式
     $shops['trade'] = Config::get("shop::copy.trade");
     $shops['url'] = 'shop.copy.category';
     return View::make('shop::copy.category', compact('shops'));
 }
예제 #3
0
 public function category()
 {
     //列表
     $para = Request::getQueryString();
     $shops = $this->shop->getGoods($this->shop, $para, '', 'logo');
     //分类
     $shops['categories'] = $this->categories;
     if (Request::get('b')) {
         $b = Request::get('b');
         if (preg_match("/^[0-9]+\$/", $b)) {
             $shops['recomment_category'] = $this->category->find($b)->toArray();
         } else {
             $c_arr = explode('c', $b);
             $shops['recomment_category'] = $this->category->find($c_arr[0])->toArray();
         }
     } else {
         $shops['recomment_category'] = $this->reco_categories;
     }
     //dd($shops['recomment_category']);
     //组合类型
     $shops['combine'] = Config::get("shop::logo.combine");
     //价格区间
     $shops['price'] = Config::get("shop::logo.price");
     //交易方式
     $shops['trade'] = Config::get("shop::logo.trade");
     $shops['url'] = 'shop.logo.category';
     return View::make('shop::logo.category', compact('shops'));
 }