ztt 9 months ago
parent 9a317037dd
commit 6fb6919685
  1. 2
      app/api/model/Category.php
  2. 4
      app/common/model/Category.php
  3. 2
      app/common/model/Goods.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]));
}
}

@ -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'])

@ -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);

Loading…
Cancel
Save