Files
kiri-core/System/Core/Number.php
T

32 lines
466 B
PHP
Raw Normal View History

2021-03-24 01:24:02 +08:00
<?php
namespace Snowflake\Core;
2021-03-24 01:25:38 +08:00
class Number
2021-03-24 01:24:02 +08:00
{
2021-03-30 19:31:12 +08:00
/**
* @param int $userId
* @return string
*/
public static function order(int $userId): string
{
$explode = current(explode(' ', str_replace('0.', '', microtime())));
return 'No.' . sprintf('%09d', $userId) . '.' . date('Ymd.His') . '.' . $explode;
}
/**
* @param int $userId
* @return string
*/
public static function create(int $userId): string
{
return static::order($userId);
}
2021-03-24 01:24:02 +08:00
}