pull/1/head
wanghousheng 10 months ago
parent 0c45f253e8
commit e13614e36f
  1. 9
      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'])

Loading…
Cancel
Save