首页修改,jk8修改,历史记录相关,api权限
This commit is contained in:
@@ -17,6 +17,13 @@ class UserScoreLog extends model
|
||||
protected $autoWriteTimestamp = true;
|
||||
protected $updateTime = false;
|
||||
|
||||
const GAME_TYPE_LIST = [
|
||||
1001 => 'Lucky Wheel', // 大转盘
|
||||
1002 => 'Golden Eggs', // 砸金蛋
|
||||
1003 => 'Daily Mission', // 每日任务
|
||||
1004 => 'Plinko Ball', // 普林科弹球
|
||||
];
|
||||
|
||||
public static function onBeforeDelete(): bool
|
||||
{
|
||||
return false;
|
||||
@@ -26,4 +33,17 @@ class UserScoreLog extends model
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function getGameTypeTextAttr($value, $data)
|
||||
{
|
||||
$gameType = $data['game_type'] ?? 0;
|
||||
|
||||
// 如果需要严格的多语言,可以在这里根据 $lang 切换,或者直接配合系统的 lang() 助手函数
|
||||
// 这里我们先直接返回对应的标准国际化名称
|
||||
return self::GAME_TYPE_LIST[$gameType] ?? 'Unknown Game';
|
||||
}
|
||||
|
||||
// 3. 别忘了把获取器追加到模型的可见输出数组里
|
||||
protected $append = ['game_type_text'];
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user