游戏-用户管理

This commit is contained in:
2026-04-01 15:51:25 +08:00
parent 0429cf62c4
commit 1d350ddb68
7 changed files with 457 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
<?php
namespace app\common\model;
use support\think\Model;
/**
* GameUser
*/
class GameUser extends Model
{
// 表名
protected $name = 'game_user';
// 自动写入时间戳字段
protected $autoWriteTimestamp = true;
// 字段类型转换
protected $type = [
'create_time' => 'integer',
'update_time' => 'integer',
];
public function getcoinAttr($value): ?float
{
return is_null($value) ? null : (float)$value;
}
public function gameChannel(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\common\model\GameChannel::class, 'game_channel_id', 'id');
}
public function admin(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\admin\model\Admin::class, 'admin_id', 'id');
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace app\common\validate;
use think\Validate;
class GameUser extends Validate
{
protected $failException = true;
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}