From 6c94d03ddf3a5b8f03142257cc8cc7cdf7c090ea Mon Sep 17 00:00:00 2001 From: zhenhui <1276357500@qq.com> Date: Mon, 13 Apr 2026 16:26:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F-=E6=B8=B8=E6=88=8F=E5=A5=96?= =?UTF-8?q?=E5=8A=B1=E6=9D=83=E9=87=8D=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/game/RewardWeight.php | 70 ++++++++ app/common/model/GameRewardWeight.php | 29 ++++ app/common/validate/GameRewardWeight.php | 31 ++++ web/src/lang/backend/en/game/rewardWeight.ts | 26 +++ .../lang/backend/zh-cn/game/rewardWeight.ts | 26 +++ .../views/backend/game/rewardWeight/index.vue | 149 ++++++++++++++++++ .../backend/game/rewardWeight/popupForm.vue | 87 ++++++++++ 7 files changed, 418 insertions(+) create mode 100644 app/admin/controller/game/RewardWeight.php create mode 100644 app/common/model/GameRewardWeight.php create mode 100644 app/common/validate/GameRewardWeight.php create mode 100644 web/src/lang/backend/en/game/rewardWeight.ts create mode 100644 web/src/lang/backend/zh-cn/game/rewardWeight.ts create mode 100644 web/src/views/backend/game/rewardWeight/index.vue create mode 100644 web/src/views/backend/game/rewardWeight/popupForm.vue diff --git a/app/admin/controller/game/RewardWeight.php b/app/admin/controller/game/RewardWeight.php new file mode 100644 index 0000000..e0e7d57 --- /dev/null +++ b/app/admin/controller/game/RewardWeight.php @@ -0,0 +1,70 @@ +model = new \app\common\model\GameRewardWeight(); + return null; + } + + /** + * 查看 + * @throws Throwable + */ + protected function _index(): Response + { + // 如果是 select 则转发到 select 方法,若未重写该方法,其实还是继续执行 index + if ($this->request && $this->request->get('select')) { + return $this->select($this->request); + } + + /** + * 1. withJoin 不可使用 alias 方法设置表别名,别名将自动使用关联模型名称(小写下划线命名规则) + * 2. 以下的别名设置了主表别名,同时便于拼接查询参数等 + * 3. paginate 数据集可使用链式操作 each(function($item, $key) {}) 遍历处理 + */ + list($where, $alias, $limit, $order) = $this->queryBuilder(); + $res = $this->model + ->withJoin($this->withJoinTable, $this->withJoinType) + ->with($this->withJoinTable) + ->visible(['gameChannel' => ['name']]) + ->alias($alias) + ->where($where) + ->order($order) + ->paginate($limit); + + return $this->success('', [ + 'list' => $res->items(), + 'total' => $res->total(), + 'remark' => get_route_remark(), + ]); + } + + /** + * 若需重写查看、编辑、删除等方法,请复制 @see \app\admin\library\traits\Backend 中对应的方法至此进行重写 + */ +} \ No newline at end of file diff --git a/app/common/model/GameRewardWeight.php b/app/common/model/GameRewardWeight.php new file mode 100644 index 0000000..2e12e2f --- /dev/null +++ b/app/common/model/GameRewardWeight.php @@ -0,0 +1,29 @@ + 'integer', + 'update_time' => 'integer', + ]; + + + public function gameChannel(): \think\model\relation\BelongsTo + { + return $this->belongsTo(\app\common\model\GameChannel::class, 'game_channel_id', 'id'); + } +} \ No newline at end of file diff --git a/app/common/validate/GameRewardWeight.php b/app/common/validate/GameRewardWeight.php new file mode 100644 index 0000000..917455b --- /dev/null +++ b/app/common/validate/GameRewardWeight.php @@ -0,0 +1,31 @@ + [], + 'edit' => [], + ]; + +} diff --git a/web/src/lang/backend/en/game/rewardWeight.ts b/web/src/lang/backend/en/game/rewardWeight.ts new file mode 100644 index 0000000..3e853b7 --- /dev/null +++ b/web/src/lang/backend/en/game/rewardWeight.ts @@ -0,0 +1,26 @@ +export default { + id: 'id', + game_channel_id: 'game_channel_id', + gamechannel__name: 'name', + direction: 'direction', + 'direction 0': 'direction 0', + 'direction 1': 'direction 1', + grid_number: 'grid_number', + start_index: 'start_index', + end_index: 'end_index', + ui_text: 'ui_text', + real_ev: 'real_ev', + tier: 'tier', + type: 'type', + 'type -2': 'type -2', + 'type -1': 'type -1', + 'type 0': 'type 0', + 'type 1': 'type 1', + 'type 2': 'type 2', + 'type 3': 'type 3', + remark: 'remark', + weight: 'weight', + create_time: 'create_time', + update_time: 'update_time', + 'quick Search Fields': 'id', +} diff --git a/web/src/lang/backend/zh-cn/game/rewardWeight.ts b/web/src/lang/backend/zh-cn/game/rewardWeight.ts new file mode 100644 index 0000000..afc9b8c --- /dev/null +++ b/web/src/lang/backend/zh-cn/game/rewardWeight.ts @@ -0,0 +1,26 @@ +export default { + id: 'ID', + game_channel_id: '渠道', + gamechannel__name: '渠道名', + direction: '方向', + 'direction 0': '顺时针', + 'direction 1': '逆时针', + grid_number: '点数', + start_index: '起始索引', + end_index: '结束索引', + ui_text: '显示文本', + real_ev: '实际中奖金额', + tier: '档位', + type: '奖励类型', + 'type -2': '唯一惩罚', + 'type -1': '抽水', + 'type 0': '回本', + 'type 1': '再来一次', + 'type 2': '小赚', + 'type 3': '大奖格', + remark: '备注', + weight: '权重', + create_time: '创建时间', + update_time: '修改时间', + 'quick Search Fields': 'ID', +} diff --git a/web/src/views/backend/game/rewardWeight/index.vue b/web/src/views/backend/game/rewardWeight/index.vue new file mode 100644 index 0000000..bdb1240 --- /dev/null +++ b/web/src/views/backend/game/rewardWeight/index.vue @@ -0,0 +1,149 @@ + + + + + diff --git a/web/src/views/backend/game/rewardWeight/popupForm.vue b/web/src/views/backend/game/rewardWeight/popupForm.vue new file mode 100644 index 0000000..60e66e4 --- /dev/null +++ b/web/src/views/backend/game/rewardWeight/popupForm.vue @@ -0,0 +1,87 @@ + + + + +