浏览代码

格式化小数

jason 4 月之前
父节点
当前提交
deb887ee59
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      application/api/controller/Exchange.php
  2. 1 1
      application/common/model/LedgerWalletModel.php

+ 1 - 1
application/api/controller/Exchange.php

@@ -59,7 +59,7 @@ class Exchange extends Api
                 'token_name' => $welfare['token_name'],
                 'token_num' => round($welfare['token_num'], 2),
                 'is_chabao' => $welfare['is_chabao'],
-                'chabao_num' => $welfare['chabao_num']
+                'chabao_num' => round($welfare['chabao_num'],2)
             ];
             $this->success('ok', ['data'=>$data_info, 'desc'=> $welfare['describe']]);
       }

+ 1 - 1
application/common/model/LedgerWalletModel.php

@@ -28,7 +28,7 @@ class LedgerWalletModel extends Model
 
     public static function getWalletChaBao($userID)
     {
-        return self::where('user_id', $userID)->value('token');
+        return round(self::where('user_id', $userID)->value('token'), 2);
     }
 
     public static function getWalletFrozen($userID)