浏览代码

gf yunfei xiufu

NoteStar 5 年之前
父节点
当前提交
b7bfa15a96
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      vendor/fancyecommerce/fecshop/services/Shipping.php

+ 4 - 3
vendor/fancyecommerce/fecshop/services/Shipping.php

@@ -189,11 +189,12 @@ class Shipping extends Service
             ];
         } else {  // 通过公式计算得到运费。
             $formula = str_replace('[weight]', $weight, $formula);
-            $currentCost = eval("return $formula;");
+            $baseCost = eval("return $formula;");
+            $currCost = Yii::$service->page->currency->getCurrentCurrencyPrice($baseCost);
             
             return [
-                'currCost'  => Yii::$service->helper->format->number_format($currentCost, 2),
-                'baseCost'  => Yii::$service->helper->format->number_format($currentCost, 2),
+                'currCost'  => Yii::$service->helper->format->number_format($currCost, 2),
+                'baseCost'  => Yii::$service->helper->format->number_format($baseCost, 2),
             ];
         }
     }