|
|
|
@ -314,6 +314,12 @@ class Goods extends BaseModel |
|
|
|
|
if (!empty($param['keyword'])) { |
|
|
|
|
$query = $query->whereRaw('goods_name like ? or goods_no like ?', ["%{$param['keyword']}%", "%{$param['keyword']}%"]); |
|
|
|
|
} |
|
|
|
|
if (!empty($param['keywords'])) { |
|
|
|
|
$where = explode(',',$param['keywords']); |
|
|
|
|
foreach ($where as $key => $val){ |
|
|
|
|
$query = $query->whereRaw('goods_name like ? or goods_no like ?', ["%{$val}%", "%{$val}%"]); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 执行查询 |
|
|
|
|
$list = $query->with(['images.file']) |
|
|
|
|
->alias($this->name) |
|
|
|
|