|
|
@ -177,6 +177,7 @@ class Goods extends BaseModel |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function getList(array $param = [], int $listRows = 15) |
|
|
|
public function getList(array $param = [], int $listRows = 15) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
// 筛选条件 |
|
|
|
// 筛选条件 |
|
|
|
$query = $this->getQueryFilter($param); |
|
|
|
$query = $this->getQueryFilter($param); |
|
|
|
// 设置显示的销量 goods_sales |
|
|
|
// 设置显示的销量 goods_sales |
|
|
@ -305,10 +306,10 @@ class Goods extends BaseModel |
|
|
|
!empty($params['goodsNo']) && $filter[] = ['goods_no', 'like', "%{$params['goodsNo']}%"]; |
|
|
|
!empty($params['goodsNo']) && $filter[] = ['goods_no', 'like', "%{$params['goodsNo']}%"]; |
|
|
|
|
|
|
|
|
|
|
|
//wmc |
|
|
|
//wmc |
|
|
|
if (isset($param['is_brand']) && $param['is_brand'] != '') { |
|
|
|
if (isset($param['is_brand']) && $param['is_brand'] !== '') { |
|
|
|
$filter[] = ['is_brand', '=', $param['is_brand']]; |
|
|
|
$filter[] = ['is_brand', '=', $param['is_brand']]; |
|
|
|
} |
|
|
|
} |
|
|
|
if (isset($param['is_new']) && $param['is_new'] != '') { |
|
|
|
if (isset($param['is_new']) && $param['is_new'] !== '') { |
|
|
|
$filter[] = ['is_new', '=', $param['is_new']]; |
|
|
|
$filter[] = ['is_new', '=', $param['is_new']]; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!empty($param['store_id']) && $a == 0) { |
|
|
|
if (!empty($param['store_id']) && $a == 0) { |
|
|
@ -320,10 +321,13 @@ class Goods extends BaseModel |
|
|
|
$query->order('paihang asc'); |
|
|
|
$query->order('paihang asc'); |
|
|
|
} |
|
|
|
} |
|
|
|
//是否店内 |
|
|
|
//是否店内 |
|
|
|
if (isset($param['is_in_store']) && $param['is_in_store'] != '') { |
|
|
|
if (isset($param['is_in_store']) && $param['is_in_store'] !== '') { |
|
|
|
$filter[] = ['is_in_store', '=', $params['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']]; |
|
|
|
|
|
|
|
} |
|
|
|
// 实例化新查询对象 |
|
|
|
// 实例化新查询对象 |
|
|
|
return $query->where($filter); |
|
|
|
return $query->where($filter); |
|
|
|
} |
|
|
|
} |
|
|
|