From 7d9d623297adac9b0d71a9779031163d59fd25c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 30 Mar 2021 19:31:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Core/Number.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/System/Core/Number.php b/System/Core/Number.php index 1463fb26..7e1c69b1 100644 --- a/System/Core/Number.php +++ b/System/Core/Number.php @@ -8,15 +8,24 @@ class Number { - /** - * @param int $userId - * @return string - */ - public static function order(int $userId): string - { - $explode = current(explode(' ', str_replace('0.', '', microtime()))); + /** + * @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; - } + 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); + } }