wanghousheng 10 months ago
parent 1de56bc79f
commit 80e9efee1d
  1. 14
      app/common/model/Goods.php

@ -407,18 +407,8 @@ class Goods extends BaseModel
$query->join($GoodsCategoryRelName, "{$GoodsCategoryRelName}.goods_id = {$this->name}.goods_id");
// 设置分类ID条件
$query->where('goods_category_rel.category_id', 'in', explode(",", (string)$params['categoryId']));
// $query->where([
// 'goods_category_rel.category_id' => (int)$params['categoryId'],
// //'goods.store_id' => (int)$params['store_id'],
// ]);
$a = 1;
}
// 商品名称
foreach (explode(",", $params['keywords'] ?? '') as $val) {
$filter[] = ['goods_name', 'like', "%{$val}%"];
}
// 商品名称
!empty($params['goodsName']) && $filter[] = ['goods_name', 'like', "%{$params['goodsName']}%"];
// 商品编码
@ -431,10 +421,6 @@ class Goods extends BaseModel
if (isset($param['is_new']) && $param['is_new'] !== '') {
$filter[] = ['is_new', '=', $param['is_new']];
}
if (!empty($param['store_id']) && $a == 0) {
$filter[] = ['store_id', '=', $param['store_id']];
}
if (!empty($param['paihang'])) {
$filter[] = ['paihang', '>', 0];
$query->order('paihang asc');

Loading…
Cancel
Save