This commit is contained in:
DESKTOP-GMUNQ1B\Administrator 2024-12-04 15:23:51 +08:00
commit 7e8f5aacf4

View File

@ -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');