[游戏管理]用户管理-优化

This commit is contained in:
2026-04-15 11:27:14 +08:00
parent c01e6430db
commit 9d06c7a226
6 changed files with 654 additions and 100 deletions

View File

@@ -15,28 +15,22 @@ class GameUser extends Model
// 自动写入时间戳字段
protected $autoWriteTimestamp = true;
// 字段类型转换
// 字段类型转换(金额 decimal(18,4) 用字符串避免浮点误差)
protected $type = [
'create_time' => 'integer',
'update_time' => 'integer',
'coin' => 'string',
'total_deposit_coin' => 'string',
'total_valid_bet_coin' => 'string',
'risk_flags' => 'integer',
'current_streak' => 'integer',
];
public function getcoinAttr($value): ?float
{
return is_null($value) ? null : (float)$value;
}
public function channel(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\common\model\Channel::class, 'channel_id', 'id');
}
public function gameChannel(): \think\model\relation\BelongsTo
{
return $this->channel();
}
public function admin(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\admin\model\Admin::class, 'admin_id', 'id');