fix(admin): 修复订单提交时商品数量为零的问题
- 在创建出库单前增加检查,确保订单中没有数量为 0 的商品 - 如果存在数量为 0 的商品,抛出异常并提示用户处理
This commit is contained in:
parent
7a742331de
commit
07b5564e0e
@ -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 = [
|
||||
|
Loading…
x
Reference in New Issue
Block a user