按照输入产品ID排序
This commit is contained in:
parent
06604a3d19
commit
7c3670dd22
|
|
@ -86,8 +86,11 @@ class ProductRepo
|
|||
});
|
||||
}
|
||||
|
||||
if (isset($data['product_ids'])) {
|
||||
$builder->whereIn('id', $data['product_ids']);
|
||||
$productIds = $data['product_ids'] ?? [];
|
||||
if ($productIds) {
|
||||
$builder->whereIn('id', $productIds);
|
||||
$productIds = implode(',', $productIds);
|
||||
$builder->orderByRaw("FIELD(products.id, {$productIds})");
|
||||
}
|
||||
|
||||
if (isset($data['sku']) || isset($data['model'])) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue