mirror of
https://github.com/v2board/v2board.git
synced 2025-06-13 13:17:52 +08:00
update: new generate order number method
This commit is contained in:
@ -23,6 +23,12 @@ class Helper
|
||||
return md5(vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(bin2hex($data), 4)) . '-' . time());
|
||||
}
|
||||
|
||||
public static function generateOrderNo(): string
|
||||
{
|
||||
$randomChar = rand(10000, 99999);
|
||||
return date('YmdHms') . $randomChar;
|
||||
}
|
||||
|
||||
public static function exchange($from, $to)
|
||||
{
|
||||
$result = file_get_contents('https://api.exchangerate.host/latest?symbols=' . $to . '&base=' . $from);
|
||||
|
Reference in New Issue
Block a user