fix(admin): 修复订单提交时商品数量为零的问题

- 在创建出库单前增加检查,确保订单中没有数量为 0 的商品
- 如果存在数量为 0 的商品,抛出异常并提示用户处理
This commit is contained in:
mkm 2024-10-18 11:43:53 +08:00
parent 7a742331de
commit 07b5564e0e

View File

@ -303,6 +303,10 @@ class BeforehandOrderLogic extends BaseLogic
throw new BusinessException('该订单已创建出库单');
}
$info = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->select();
$count = BeforehandOrderCartInfo::where('bhoid', $params['bhoid'])->where('cart_num',0)->count('id');
if($count > 0){
throw new BusinessException('订单中有数量为0的商品请先处理');
}
Db::startTrans();
try {
$arr = [