diff --git a/app/admin/controller/game/User.php b/app/admin/controller/user/User.php similarity index 98% rename from app/admin/controller/game/User.php rename to app/admin/controller/user/User.php index cf3585a..358758c 100644 --- a/app/admin/controller/game/User.php +++ b/app/admin/controller/user/User.php @@ -1,6 +1,6 @@ model = new \app\common\model\GameUser(); + $this->model = new \app\common\model\User(); return null; } diff --git a/app/common/model/GameUser.php b/app/common/model/GameUser.php deleted file mode 100644 index 52be576..0000000 --- a/app/common/model/GameUser.php +++ /dev/null @@ -1,38 +0,0 @@ - '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'); - } -} \ No newline at end of file diff --git a/app/common/model/User.php b/app/common/model/User.php index 8debfbb..8d1b706 100644 --- a/app/common/model/User.php +++ b/app/common/model/User.php @@ -2,42 +2,34 @@ namespace app\common\model; -use app\common\model\traits\TimestampInteger; use support\think\Model; /** - * 会员公共模型 + * 用户主表 */ class User extends Model { - use TimestampInteger; + protected $name = 'user'; - protected string $table = 'user'; - protected string $pk = 'id'; - protected bool $autoWriteTimestamp = true; + protected $autoWriteTimestamp = true; - public function getAvatarAttr($value): string + 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 full_url($value, false, config('buildadmin.default_avatar')); + return $this->belongsTo(Channel::class, 'channel_id', 'id'); } - public function setAvatarAttr($value): string + public function admin(): \think\model\relation\BelongsTo { - return $value == full_url('', false, config('buildadmin.default_avatar')) ? '' : $value; - } - - public function resetPassword($uid, $newPassword) - { - return $this->where(['id' => $uid])->update(['password' => hash_password($newPassword), 'salt' => '']); - } - - public function getMoneyAttr($value): string - { - return bcdiv((string)$value, '100', 2); - } - - public function setMoneyAttr($value): string - { - return bcmul((string)$value, '100', 2); + return $this->belongsTo(\app\admin\model\Admin::class, 'admin_id', 'id'); } } diff --git a/app/common/validate/GameUser.php b/app/common/validate/GameUser.php deleted file mode 100644 index b85e1f4..0000000 --- a/app/common/validate/GameUser.php +++ /dev/null @@ -1,31 +0,0 @@ - [], - 'edit' => [], - ]; - -} diff --git a/web/src/lang/backend/en/user/user.ts b/web/src/lang/backend/en/user/user.ts new file mode 100644 index 0000000..6a8a0a7 --- /dev/null +++ b/web/src/lang/backend/en/user/user.ts @@ -0,0 +1,45 @@ +export default { + id: 'ID', + username: 'Username', + password: 'Password', + uuid: 'UUID', + phone: 'Phone', + email: 'Email', + email_placeholder: 'Optional (register with phone or email)', + head_image: 'Avatar', + remark: 'Remark', + coin: 'Coin balance', + coin_placeholder: 'decimal(18,4)', + total_deposit_coin: 'Total deposit (coin)', + total_valid_bet_coin: 'Total valid bet (coin)', + risk_flags: 'Risk', + risk_none: 'None', + risk_no_login: 'No login', + risk_no_bet: 'No bet', + risk_no_withdraw: 'No withdraw', + current_streak: 'Win streak', + last_bet_period_no: 'Last bet period', + last_bet_period_no_placeholder: 'DB fallback for streak', + register_invite_code: 'Invite code (snapshot)', + register_invite_code_placeholder: 'Invite code at registration', + status: 'Status', + 'status 0': 'Disabled', + 'status 1': 'Enabled', + section_admin_attribution: 'Administrator', + admin_affiliation: 'Assigned admin', + admin_affiliation_placeholder: 'Role group tree — only admins in your scope', + register_invite_code_auto_placeholder: 'Filled from selected admin invite code', + channel_id: 'Channel', + channel__name: 'Channel', + admin_id: 'Admin', + admin__username: 'Admin', + create_time: 'Created', + update_time: 'Updated', + 'quick Search Fields': 'ID, username, phone, email, invite code', + section_basic: 'Account', + section_register: 'Registration', + section_finance: 'Balance & turnover', + section_risk: 'Risk control', + section_streak: 'Streak (fallback)', + section_other: 'Other', +} diff --git a/web/src/lang/backend/zh-cn/user/user.ts b/web/src/lang/backend/zh-cn/user/user.ts new file mode 100644 index 0000000..70f299d --- /dev/null +++ b/web/src/lang/backend/zh-cn/user/user.ts @@ -0,0 +1,45 @@ +export default { + id: 'ID', + username: '用户名', + password: '密码', + uuid: '用户唯一标识', + phone: '手机号', + email: '邮箱', + email_placeholder: '可选,与手机号二选一注册时填写', + head_image: '头像', + remark: '备注', + coin: '游戏币余额', + coin_placeholder: 'decimal(18,4),禁止业务用浮点存库', + total_deposit_coin: '累计充值(币)', + total_valid_bet_coin: '累计有效投注(币)', + risk_flags: '风控', + risk_none: '无限制', + risk_no_login: '禁止登录', + risk_no_bet: '禁止下注', + risk_no_withdraw: '禁止提现', + current_streak: '当前连胜', + last_bet_period_no: '最近下注期号', + last_bet_period_no_placeholder: '连胜兜底同步用,可与 Redis 对照', + register_invite_code: '注册邀请码快照', + register_invite_code_placeholder: '注册时绑定渠道/代理邀请码', + status: '状态', + 'status 0': '禁用', + 'status 1': '启用', + section_admin_attribution: '管理员归属', + admin_affiliation: '归属管理员', + admin_affiliation_placeholder: '按角色组展开,仅展示您可管理范围内的管理员', + register_invite_code_auto_placeholder: '随所选管理员邀请码自动带出', + channel_id: '所属渠道', + channel__name: '渠道名', + admin_id: '归属管理员', + admin__username: '管理员', + create_time: '创建时间', + update_time: '修改时间', + 'quick Search Fields': 'ID、用户名、手机号、邮箱、邀请码', + section_basic: '账号信息', + section_register: '注册与邀请', + section_finance: '资金与流水', + section_risk: '风控', + section_streak: '连胜(兜底)', + section_other: '其他', +} diff --git a/web/src/views/backend/game/user/index.vue b/web/src/views/backend/user/user/index.vue similarity index 79% rename from web/src/views/backend/game/user/index.vue rename to web/src/views/backend/user/user/index.vue index 20b674a..a4f3731 100644 --- a/web/src/views/backend/game/user/index.vue +++ b/web/src/views/backend/user/user/index.vue @@ -1,10 +1,10 @@ -