作者 耿培杰

修改接口

... ... @@ -225,7 +225,7 @@ class Goods extends Api
if (!empty($params['category2_id'])) $where['category2_id'] = $params['category2_id'];
//获取筛选标签,国家,品牌,等级,部位,品类
$data = $this->categoryModel->getExtend($where,$this->lang);
$data['extend'] = $this->categoryModel->getExtend($where,$this->lang);
//获取三级分类
$data['category_three'] = $this->categoryModel->selectData(['pid'=>$params['category_two_id']],null,$this->lang);
//获取列表数据
... ...
... ... @@ -48,11 +48,17 @@ class Category extends Model
if ($lang == 'ch') $field = 'id,ch_name name';
else $field = 'id,en_name name';
$data['country'] = Db::name('country')->where(['id'=>['in',array_unique($countryids)]])->field($field)->select();
$data['brand'] = Db::name('brand')->where(['id'=>['in',array_unique($brandids)]])->field($field)->select();
$data['level'] = Db::name('level')->where(['id'=>['in',array_unique($levelids)]])->field($field)->select();
$data['part'] = Db::name('part')->where(['id'=>['in',array_unique($partids)]])->field($field)->select();
$data['category2'] = Db::name('category2')->where(['id'=>['in',array_unique($category2ids)]])->field($field)->select();
$country = Db::name('country')->where(['id'=>['in',array_unique($countryids)]])->field($field)->select();
$brand = Db::name('brand')->where(['id'=>['in',array_unique($brandids)]])->field($field)->select();
$level = Db::name('level')->where(['id'=>['in',array_unique($levelids)]])->field($field)->select();
$part = Db::name('part')->where(['id'=>['in',array_unique($partids)]])->field($field)->select();
$category2 = Db::name('category2')->where(['id'=>['in',array_unique($category2ids)]])->field($field)->select();
if ($country) $data[] = ['title' => '国家','list'=>$country];
if ($brand) $data[] = ['title' => '品牌','list'=>$brand];
if ($level) $data[] = ['title' => '等级','list'=>$level];
if ($part) $data[] = ['title' => '部位','list'=>$part];
if ($category2) $data[] = ['title' => '品类','list'=>$category2];
return $data;
}
... ...