diff --git a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php index 3e4c0ee5..0433816d 100644 --- a/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php +++ b/app/admin/logic/purchase_product_offer/PurchaseProductOfferLogic.php @@ -498,6 +498,8 @@ class PurchaseProductOfferLogic extends BaseLogic $purchaseOffer = []; $cartInfo = []; foreach ($params['product_arr'] as $product) { + $product['price'] = trim($product['price']); + $product['nums'] = trim($product['nums']); if ($product['product_id'] <= 0) { continue; } @@ -542,7 +544,7 @@ class PurchaseProductOfferLogic extends BaseLogic BeforehandOrderCartInfo::insertAll($cartInfo); Db::commit(); return true; - } catch (\Exception $e) { + } catch (\Throwable $e) { Db::rollback(); throw new BusinessException($e->getMessage()); }