Merge pull request 'dev' (#488) from dev into main

Reviewed-on: #488
This commit is contained in:
mkm 2025-01-24 14:12:58 +08:00
commit d1f51031ef
2 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
public static function appendAdd(array $params): bool
{
$order = BeforehandOrder::where('id', $params['id'])->find();
if (!empty($order) && $order->is_confirm == 1 && empty($params['admin_id'])) {
if ((!empty($order) && $order->is_confirm == 1 && empty($params['admin_id'])) || $order['is_outbound'] > 0) {
throw new BusinessException('该订单已确认,不能追加商品');
}
Db::startTrans();

View File

@ -38,7 +38,7 @@ class WarehouseProductLogic extends BaseLogic
// Db::startTrans();
try {
$after_nums = 0;
if (!in_array($params['order_type'],[6,7,9])) {
if (!in_array($params['order_type'],[6,9])) {
$storege = WarehouseProductStorege::where('warehouse_id', $params['warehouse_id'])->where('product_id', $params['product_id'])->find();
if ($storege) {
$after_nums = $storege['nums'] + $params['nums'];
@ -262,9 +262,9 @@ class WarehouseProductLogic extends BaseLogic
Db::startTrans();
try {
if ($res['financial_pm'] == 1) {
self::incProductDecStorege($res, $res['nums'], $admin_id);
} elseif ($res['financial_pm'] == 0) {
self::decProductIncStorege($res, $res['nums'], $admin_id);
} elseif ($res['financial_pm'] == 0) {
self::incProductDecStorege($res, $res['nums'], $admin_id);
}
$res->delete();
Db::commit();