[游戏管理]用户管理-优化
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user