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

Reviewed-on: #541
This commit is contained in:
mkm 2025-03-06 11:23:19 +08:00
commit d01debfc77

View File

@ -498,6 +498,8 @@ class PurchaseProductOfferLogic extends BaseLogic
$purchaseOffer = []; $purchaseOffer = [];
$cartInfo = []; $cartInfo = [];
foreach ($params['product_arr'] as $product) { foreach ($params['product_arr'] as $product) {
$product['price'] = trim($product['price']);
$product['nums'] = trim($product['nums']);
if ($product['product_id'] <= 0) { if ($product['product_id'] <= 0) {
continue; continue;
} }
@ -542,7 +544,7 @@ class PurchaseProductOfferLogic extends BaseLogic
BeforehandOrderCartInfo::insertAll($cartInfo); BeforehandOrderCartInfo::insertAll($cartInfo);
Db::commit(); Db::commit();
return true; return true;
} catch (\Exception $e) { } catch (\Throwable $e) {
Db::rollback(); Db::rollback();
throw new BusinessException($e->getMessage()); throw new BusinessException($e->getMessage());
} }