kevin_zhangl 2 лет назад
Родитель
Сommit
0bf0715c38
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      frontendApi/modules/v1/controllers/ShopController.php

+ 3 - 2
frontendApi/modules/v1/controllers/ShopController.php

@@ -422,8 +422,9 @@ class ShopController extends BaseController {
         // 马来币汇率
         $exchangeRateMYR = floatval(Cache::getSystemConfig()['exchangeRateMYR']['VALUE'] ?? 0);
         // 计算马来币
-        $amount = number_format($money * $exchangeRateMYR, 0, '.', '');
-//        $amount = number_format(1, 2, '.', ''); // TODO: 测试
+        $money = intval($money);
+        $amount = number_format($money * $exchangeRateMYR, 2, '.', '');
+        $amount = number_format(1, 2, '.', ''); // TODO: 测试
         $paymentParams['Amount'] = str_replace('.', '', $amount);
         // (Optional) (int)
         $paymentParams['PaymentId'] = '2';   // TODO: 2=MYR