diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 1715a0fe3..4e0df24c0 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -159,6 +159,11 @@ class BeforehandOrderCartInfoLogic extends BaseLogic throw new BusinessException('请勿重复入库'); } $offer_list = PurchaseProductOffer::where(['order_id' => $params['bhoid'], 'is_storage' => 0])->select(); + foreach ($offer_list as $k => $v) { + if($v['buyer_nums']<=0){ + throw new BusinessException('采购数量不能为0'); + } + } $total_price= PurchaseProductOffer::where(['order_id' => $params['bhoid']])->sum('total_price'); $completed_amount= PurchaseProductOffer::where(['order_id' => $params['bhoid'],'pay_type'=>1])->sum('total_price'); $outstanding_amount= PurchaseProductOffer::where(['order_id' => $params['bhoid'],'pay_type'=>2])->sum('total_price');