From 0f94b7e7bfd97b08623382bae20990c0a6ba48d7 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 13 May 2023 17:00:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B4=AD=E7=89=A9=E8=BD=A6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/store/product/ProductAttrValue.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/common/model/store/product/ProductAttrValue.php b/app/common/model/store/product/ProductAttrValue.php index 77b8860a..013c2f81 100644 --- a/app/common/model/store/product/ProductAttrValue.php +++ b/app/common/model/store/product/ProductAttrValue.php @@ -14,6 +14,7 @@ namespace app\common\model\store\product; use app\common\model\BaseModel; +use think\facade\Log; class ProductAttrValue extends BaseModel { @@ -52,11 +53,16 @@ class ProductAttrValue extends BaseModel public function getSvipPriceAttr() { - if ($this->product->product_type == 0 && $this->product->show_svip_price && $this->product->svip_price_type == 1) { - $rate = merchantConfig($this->product->mer_id,'svip_store_rate'); - $svip_store_rate = $rate > 0 ? bcdiv($rate,100,2) : 0; - return bcmul($this->price, $svip_store_rate,2); + try { + if ($this->product->product_type == 0 && $this->product->show_svip_price && $this->product->svip_price_type == 1) { + $rate = merchantConfig($this->product->mer_id,'svip_store_rate'); + $svip_store_rate = $rate > 0 ? bcdiv($rate,100,2) : 0; + return bcmul($this->price, $svip_store_rate,2); + } + }catch (\Exception $e){ + Log::error([$e->getMessage(),$e->getLine(),$e->getFile()]); } + return $this->getData('svip_price'); }