Files
kiri-core/kiri-engine/Core/Number.php
T
2021-10-28 15:41:31 +08:00

32 lines
462 B
PHP

<?php
namespace Kiri\Core;
class Number
{
/**
* @param int $userId
* @return string
*/
public static function order(int $userId): string
{
$explode = current(explode(' ', str_replace('0.', '', microtime())));
return 'No.' . sprintf('%010d', $userId) . '.' . date('Ymd.His') . '.' . $explode;
}
/**
* @param int $userId
* @return string
*/
public static function create(int $userId): string
{
return static::order($userId);
}
}