mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-21 01:27:23 +08:00
chore: code style and type declaration improvements
This commit is contained in:
@@ -172,7 +172,8 @@ class GiftCardCode extends Model
|
||||
public static function generateCode(string $prefix = 'GC'): string
|
||||
{
|
||||
do {
|
||||
$code = $prefix . strtoupper(substr(md5(uniqid(mt_rand(), true)), 0, 12));
|
||||
$safePrefix = (string) $prefix;
|
||||
$code = $safePrefix . strtoupper(substr(md5(uniqid($safePrefix . mt_rand(), true)), 0, 12));
|
||||
} while (self::where('code', $code)->exists());
|
||||
|
||||
return $code;
|
||||
|
||||
Reference in New Issue
Block a user