1.优化开奖逻辑

2.优化后台开奖派彩
3.优化接口规范
This commit is contained in:
2026-04-17 13:56:13 +08:00
parent 3cf386756b
commit bf3d50a309
50 changed files with 1036 additions and 770 deletions

View File

@@ -13,6 +13,30 @@ class User extends Model
protected $autoWriteTimestamp = true;
/**
* 生成 10 位唯一对外标识(大写字母与数字,排除易混淆字符)
*/
public static function generateUniquePublicCode10(): string
{
$chars = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
$len = strlen($chars);
for ($attempt = 0; $attempt < 80; $attempt++) {
$code = '';
for ($i = 0; $i < 10; $i++) {
$code .= $chars[random_int(0, $len - 1)];
}
if (!self::where('uuid', $code)->find()) {
return $code;
}
}
throw new \RuntimeException('Failed to generate unique user uuid');
}
public static function formatLoginRemark(int $timestamp, string $ip): string
{
return '最后登录:' . date('Y-m-d H:i:s', $timestamp) . ' IP:' . $ip;
}
protected $type = [
'create_time' => 'integer',
'update_time' => 'integer',