6
0
Fork 0

调整订单发货bug

release
vine_liutk 2022-03-24 13:43:46 +08:00
parent 968050e108
commit 7240f87688
1 changed files with 6 additions and 3 deletions

View File

@ -25,10 +25,10 @@ class OrderPackageService
if (!($order->isWaitShipping() || $order->isShipping())) {
throw new BizException('订单状态异常,无法发货');
}
if (!isset($params['packages']) || count($params['packages']) <= 0) {
throw new BizException('请选择发货商品');
}
foreach ($params['packages'] as $item) {
if (isset($item['_remove_']) && $item['_remove_']) {//如果是已被移除选项则直接移除
continue;
}
if ($item['quantity'] < 1) {
throw new BizException('发货数量不能小于1');
}
@ -41,6 +41,9 @@ class OrderPackageService
];
}
}
if (count($packageProducts) <= 0) {
throw new BizException('请选择发货商品');
}
foreach ($packageProducts as $product) {
$_orderProduct = OrderProduct::where('order_id', $order->id)
->where('after_sale_state', '<>', 1)