This commit is contained in:
mkm 2024-01-04 16:51:09 +08:00
parent 6ad6d19a7c
commit 9e79002c96

View File

@ -47,7 +47,7 @@ class SpuDao extends BaseDao
if(isset($where['order']) && $where['order'] === 'none'){
$order = '';
}
$query = Spu::getDB()->alias('S')->join('StoreProduct P','S.product_id = P.product_id', 'left')->where('P.product_type',$where['product_type']);
$query = Spu::getDB()->alias('S')->join('StoreProduct P','S.product_id = P.product_id', 'left');
$query->when(isset($where['is_del']) && $where['is_del'] !== '',function($query)use($where){
$query->where('P.is_del',$where['is_del']);
})
@ -57,6 +57,9 @@ class SpuDao extends BaseDao
->when(isset($where['mer_id']) && $where['mer_id'] !== '',function($query)use($where){
$query->where('P.mer_id',$where['mer_id']);
})
->when(isset($where['product_type']) && $where['product_type'] !== '',function($query)use($where){
$query->where('P.product_type',$where['product_type']);
})
->when(isset($where['mer_array_id']),function($query)use($where){
$query->whereIn('P.mer_id',$where['mer_array_id']);
})