diff --git a/app/api/model/Category.php b/app/api/model/Category.php index e07281d6..d0a93961 100644 --- a/app/api/model/Category.php +++ b/app/api/model/Category.php @@ -41,8 +41,6 @@ class Category extends CategoryModel */ public function getListPublic(array $param = []): array { - //添加店内分类 - $param['is_in_store'] = !empty($param['is_in_store']) ? $param['is_in_store'] : 0; return parent::getList(array_merge($param, ['status' => 1])); } } diff --git a/app/common/model/Category.php b/app/common/model/Category.php index 180d4034..40a4e0f4 100644 --- a/app/common/model/Category.php +++ b/app/common/model/Category.php @@ -90,6 +90,10 @@ class Category extends BaseModel if (!empty($_GET['is_hot']) && $_GET['is_hot'] == 1) { $filter[] = ['is_hot', '=', $params['is_hot']]; } + //添加店内分类 +// if (!empty($param['is_in_store']) && $param['is_in_store'] == 1) { + $filter[] = ['is_in_store', '=', $params['is_in_store'] ?? 0]; +// } // 查询列表数据 return $this->with(['image']) diff --git a/app/common/model/Goods.php b/app/common/model/Goods.php index a2b75a25..c92e770a 100644 --- a/app/common/model/Goods.php +++ b/app/common/model/Goods.php @@ -319,6 +319,8 @@ class Goods extends BaseModel $filter[] = ['paihang', '>', 0]; $query->order('paihang asc'); } + //是否店内 + $filter[] = ['is_in_store', '=', $params['is_in_store'] ?? 0]; // 实例化新查询对象 return $query->where($filter);