wallet
This commit is contained in:
31
app/Tools/Math.php
Normal file
31
app/Tools/Math.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
namespace App\Tools;
|
||||
|
||||
class Math
|
||||
{
|
||||
const SCALE = 8;
|
||||
const SCALE_4 = 4;
|
||||
const SCALE_6= 6;
|
||||
static function bcMul($a1,$a2,$scale = self::SCALE): string
|
||||
{
|
||||
return bcmul($a1,$a2,$scale);
|
||||
}
|
||||
|
||||
static function bcSub($a1,$a2,$scale = self::SCALE): string
|
||||
{
|
||||
return bcsub($a1,$a2,$scale);
|
||||
}
|
||||
|
||||
static function bcAdd($a1,$a2,$scale = self::SCALE): string
|
||||
{
|
||||
return bcadd($a1,$a2,$scale);
|
||||
}
|
||||
|
||||
static function bcComp($a1,$a2,$scale = self::SCALE): string
|
||||
{
|
||||
return bccomp($a1,$a2,$scale);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
12
app/Tools/Times.php
Normal file
12
app/Tools/Times.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace App\Tools;
|
||||
|
||||
class Times
|
||||
{
|
||||
//获取当前时间
|
||||
public static function getNowDateTime($format = 'Y-m-d H:i:s'): string
|
||||
{
|
||||
return date($format);
|
||||
}
|
||||
|
||||
}
|
||||
@ -61,6 +61,11 @@ class Tools
|
||||
return json_decode($aData, JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
static function getMd5($value,$salt = ''): string
|
||||
{
|
||||
return md5(md5($value.$salt));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user