|
|
|
@ -194,7 +194,7 @@ class Goods extends BaseModel |
|
|
|
|
$this->getPk() => 'desc', |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$field = $this->getAliasFields($this->name, ['content']); |
|
|
|
@ -311,6 +311,7 @@ class Goods extends BaseModel |
|
|
|
|
'goodsName' => null, // 商品名称 |
|
|
|
|
'goodsNo' => null, // 商品编码 |
|
|
|
|
'status' => 0, // 商品状态(0全部 10上架 20下架) |
|
|
|
|
'keywords' => [] |
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
// 实例化新查询对象 |
|
|
|
@ -343,6 +344,10 @@ class Goods extends BaseModel |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
// 商品名称 |
|
|
|
|
if(count($params['keywords']) > 0 ) { |
|
|
|
|
$filter[] = ['goods_name', 'like', "%{$params['keywords']}%"]; |
|
|
|
|
} |
|
|
|
|
// 商品名称 |
|
|
|
|
!empty($params['goodsName']) && $filter[] = ['goods_name', 'like', "%{$params['goodsName']}%"]; |
|
|
|
|
// 商品编码 |
|
|
|
|
!empty($params['goodsNo']) && $filter[] = ['goods_no', 'like', "%{$params['goodsNo']}%"]; |
|
|
|
@ -366,7 +371,7 @@ class Goods extends BaseModel |
|
|
|
|
if (isset($param['is_in_store']) && $param['is_in_store'] !== '') { |
|
|
|
|
$filter[] = ['is_in_store', '=', $params['is_in_store']]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isset($param['store_id']) && $param['store_id'] !== '') { |
|
|
|
|
$filter[] = ['goods.store_id', '=', $params['store_id']]; |
|
|
|
|
} |
|
|
|
@ -391,7 +396,7 @@ class Goods extends BaseModel |
|
|
|
|
|
|
|
|
|
// 遍历商品列表整理数据 |
|
|
|
|
foreach ($list as &$goods) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$goods = $this->setGoodsData($goods, $callback); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|