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

32 lines
462 B
PHP
Raw Normal View History

2021-03-24 01:24:02 +08:00
<?php
2021-08-11 01:04:57 +08:00
namespace Kiri\Core;
2021-03-24 01:24:02 +08:00
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())));
2021-10-28 15:41:31 +08:00
return 'No.' . sprintf('%010d', $userId) . '.' . date('Ymd.His') . '.' . $explode;
2021-03-30 19:31:12 +08:00
}
/**
* @param int $userId
* @return string
*/
public static function create(int $userId): string
{
return static::order($userId);
}
2021-03-24 01:24:02 +08:00
}