修复购物车显示错误

This commit is contained in:
mkm 2023-05-13 17:00:46 +08:00
parent fd8324866f
commit 0f94b7e7bf

View File

@ -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');
}