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