diff --git a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php index 0259c9ff5..be9419832 100644 --- a/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php +++ b/app/admin/logic/beforehand_order_cart_info/BeforehandOrderCartInfoLogic.php @@ -127,10 +127,13 @@ class BeforehandOrderCartInfoLogic extends BaseLogic if($params['bhoid']<=0){ throw new BusinessException('参数错误'); } - $count = PurchaseProductOffer::where(['order_id' => $params['bhoid'], 'is_storage' => 0, 'buyer_nums' => 0])->count('id'); + $count = PurchaseProductOffer::where(['order_id' => $params['bhoid'], 'buyer_confirm' => 0])->count('id'); $beforehandOrder = BeforehandOrder::where('id', $params['bhoid'])->field('order_type,warehousing_id')->find(); - if ($count > 0 || $beforehandOrder['warehousing_id'] > 0) { + if ($count > 0) { + throw new BusinessException('还有商品正在采购中,请先设置采购信息在入库'); + } + if ($beforehandOrder['warehousing_id'] > 0) { throw new BusinessException('请勿重复入库'); } $offer_list = PurchaseProductOffer::where(['order_id' => $params['bhoid'], 'is_storage' => 0])->select();