diff --git a/app/common/model/Category.php b/app/common/model/Category.php index 150bd2e8..736066fe 100644 --- a/app/common/model/Category.php +++ b/app/common/model/Category.php @@ -13,8 +13,8 @@ declare (strict_types=1); namespace app\common\model; use cores\BaseModel; -use think\model\relation\HasOne; use think\model\relation\HasMany; +use think\model\relation\HasOne; /** * 商品分类模型 @@ -86,9 +86,12 @@ class Category extends BaseModel // 设置检索条件 $filter = []; $params['status'] > -1 && $filter[] = ['status', '=', $params['status']]; - if ($_GET['is_hot'] == 1) { - $filter[] = ['is_hot','=',1]; + if (!empty($params['is_hot'])) { + $filter[] = ['is_hot', '=', $params['is_hot']]; } +// if ($_GET['is_hot'] == 1) { +// $filter[] = ['is_hot','=',1]; +// } // 查询列表数据 return $this->with(['image'])