商品筛选
This commit is contained in:
parent
af58eb52f1
commit
9052087431
|
|
@ -221,12 +221,15 @@ class ProductRepo
|
|||
|
||||
public static function getFilterPrice($data)
|
||||
{
|
||||
$priceArr = explode('-', $data['price']);
|
||||
unset($data['price']);
|
||||
$builder = self::getBuilder($data)->leftJoin('product_skus as ps', 'products.id', 'ps.product_id')
|
||||
->where('ps.is_default', 1);
|
||||
|
||||
return [
|
||||
'min' => $builder->min('ps.price'),
|
||||
'max' => $builder->max('ps.price'),
|
||||
'select_min' => $priceArr[0],
|
||||
'select_max' => $priceArr[1],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue