Files
webman-buildadmin/app/common/model/GameUser.php

38 lines
935 B
PHP

<?php
namespace app\common\model;
use support\think\Model;
/**
* GameUser
*/
class GameUser extends Model
{
// 表名
protected $name = 'game_user';
// 自动写入时间戳字段
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 channel(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\common\model\Channel::class, 'channel_id', 'id');
}
public function admin(): \think\model\relation\BelongsTo
{
return $this->belongsTo(\app\admin\model\Admin::class, 'admin_id', 'id');
}
}