Files
webman-buildadmin/app/common/model/GameUser.php
2026-04-01 15:51:25 +08:00

39 lines
820 B
PHP

<?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');
}
}