This commit is contained in:
as2252258@163.com
2021-03-24 01:17:43 +08:00
parent ae94134a78
commit 3bbabd2767
+13
View File
@@ -266,4 +266,17 @@ class Str
return preg_replace('/(\w{10})(\w{3})(\w{4})(\w{9})(\w{6})/', '$1-$2-$3-$4-$5', $md5); return preg_replace('/(\w{10})(\w{3})(\w{4})(\w{9})(\w{6})/', '$1-$2-$3-$4-$5', $md5);
} }
/**
* @param int $userId
* @return string
*/
public static function getNo(int $userId)
{
$explode = explode(' ', str_replace('0.', '', microtime()));
return 'No.' . sprintf('%09d', $userId) . '.' . date('YmdHis') . '.' . current($explode);
}
} }