作者 耿培杰

修改接口

@@ -225,7 +225,7 @@ class Goods extends Api @@ -225,7 +225,7 @@ class Goods extends Api
225 if (!empty($params['category2_id'])) $where['category2_id'] = $params['category2_id']; 225 if (!empty($params['category2_id'])) $where['category2_id'] = $params['category2_id'];
226 226
227 //获取筛选标签,国家,品牌,等级,部位,品类 227 //获取筛选标签,国家,品牌,等级,部位,品类
228 - $data = $this->categoryModel->getExtend($where,$this->lang); 228 + $data['extend'] = $this->categoryModel->getExtend($where,$this->lang);
229 //获取三级分类 229 //获取三级分类
230 $data['category_three'] = $this->categoryModel->selectData(['pid'=>$params['category_two_id']],null,$this->lang); 230 $data['category_three'] = $this->categoryModel->selectData(['pid'=>$params['category_two_id']],null,$this->lang);
231 //获取列表数据 231 //获取列表数据
@@ -48,11 +48,17 @@ class Category extends Model @@ -48,11 +48,17 @@ class Category extends Model
48 if ($lang == 'ch') $field = 'id,ch_name name'; 48 if ($lang == 'ch') $field = 'id,ch_name name';
49 else $field = 'id,en_name name'; 49 else $field = 'id,en_name name';
50 50
51 - $data['country'] = Db::name('country')->where(['id'=>['in',array_unique($countryids)]])->field($field)->select();  
52 - $data['brand'] = Db::name('brand')->where(['id'=>['in',array_unique($brandids)]])->field($field)->select();  
53 - $data['level'] = Db::name('level')->where(['id'=>['in',array_unique($levelids)]])->field($field)->select();  
54 - $data['part'] = Db::name('part')->where(['id'=>['in',array_unique($partids)]])->field($field)->select();  
55 - $data['category2'] = Db::name('category2')->where(['id'=>['in',array_unique($category2ids)]])->field($field)->select(); 51 + $country = Db::name('country')->where(['id'=>['in',array_unique($countryids)]])->field($field)->select();
  52 + $brand = Db::name('brand')->where(['id'=>['in',array_unique($brandids)]])->field($field)->select();
  53 + $level = Db::name('level')->where(['id'=>['in',array_unique($levelids)]])->field($field)->select();
  54 + $part = Db::name('part')->where(['id'=>['in',array_unique($partids)]])->field($field)->select();
  55 + $category2 = Db::name('category2')->where(['id'=>['in',array_unique($category2ids)]])->field($field)->select();
  56 +
  57 + if ($country) $data[] = ['title' => '国家','list'=>$country];
  58 + if ($brand) $data[] = ['title' => '品牌','list'=>$brand];
  59 + if ($level) $data[] = ['title' => '等级','list'=>$level];
  60 + if ($part) $data[] = ['title' => '部位','list'=>$part];
  61 + if ($category2) $data[] = ['title' => '品类','list'=>$category2];
56 62
57 return $data; 63 return $data;
58 } 64 }