a订单导出
This commit is contained in:
parent
c60786f798
commit
985d4c8b59
@ -92,7 +92,7 @@ class GoodsCombinationController extends Controller
|
||||
}
|
||||
$finalIds = array_merge($finalIds, array_keys($goodsSkus));
|
||||
$idField = implode(',', $finalIds);
|
||||
$goodsSkusBuilder->orderByRaw("FIELD(id, {$idField})");
|
||||
$goodsSkusBuilder->orderByRaw("FIELD({$idField},id) {$sortValue}");
|
||||
} else {
|
||||
$goodsSkusBuilder->orderBy($sortField, $sortValue);
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ class GoodsSkusController extends Controller
|
||||
|
||||
$sortField = $request->input('sort_field', 'id');//stock sale_stock order_goods_num
|
||||
$sortValue = $request->input('sort_value', 'desc');
|
||||
$goodsSkusBuilder = (clone $builder)->with(['goods' => function ($query) {
|
||||
$goodsSkusBuilder = (clone $builder)->filter()->with(['goods' => function ($query) {
|
||||
$query->with(['type' => function ($query) {
|
||||
$query->with("parentType:id,name")->select(["id", "name", "parent_id"]);
|
||||
}]);
|
||||
@ -128,7 +128,7 @@ class GoodsSkusController extends Controller
|
||||
}
|
||||
$finalIds = array_merge($finalIds, array_keys($goodsSkus));
|
||||
$idField = implode(',', $finalIds);
|
||||
$goodsSkusBuilder->orderByRaw("FIELD(id, {$idField})");
|
||||
$goodsSkusBuilder->orderByRaw("FIELD({$idField},id) {$sortValue}");
|
||||
} else {
|
||||
$goodsSkusBuilder->orderBy($sortField, $sortValue);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user