|
@ -44,6 +44,7 @@ class DeliveryManager |
|
|
$model->goods_id = $value->goods_id; |
|
|
$model->goods_id = $value->goods_id; |
|
|
$model->goods_name = $value->goods_name; |
|
|
$model->goods_name = $value->goods_name; |
|
|
$model->goods_count = $value->goods_count; |
|
|
$model->goods_count = $value->goods_count; |
|
|
|
|
|
/*如果是部分发货*/ |
|
|
if ($model->goods_count < $value->lack_number) { |
|
|
if ($model->goods_count < $value->lack_number) { |
|
|
$order->status = Order::STATUS_SHIPMENT_PORTION; |
|
|
$order->status = Order::STATUS_SHIPMENT_PORTION; |
|
|
} |
|
|
} |
|
@ -51,10 +52,17 @@ class DeliveryManager |
|
|
throw new Exception('delivery_goods save false'); |
|
|
throw new Exception('delivery_goods save false'); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (!$order->save()) { |
|
|
if (!$order->save()) { |
|
|
throw new Exception('order shipping_status update false'); |
|
|
throw new Exception('order shipping_status update false'); |
|
|
} |
|
|
} |
|
|
|
|
|
if ($order->status == Order::STATUS_SHIPMENT_PORTION|| Delivery::findOne(['!=', 'id', $delivery->id])) { |
|
|
|
|
|
$delivery->type = Delivery::TYPE_SHIPMENT_PORTION; |
|
|
|
|
|
} else { |
|
|
|
|
|
$delivery->type = Delivery::TYPE_SHIPMENT_ALL; |
|
|
|
|
|
} |
|
|
|
|
|
if (!$delivery->save()) { |
|
|
|
|
|
throw new Exception('保存物流信息失败'); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
$transaction->commit(); |
|
|
$transaction->commit(); |
|
|
return ['status' => true]; |
|
|
return ['status' => true]; |
|
|