diff --git a/application/admin/controller/zy/GameMatch.php b/application/admin/controller/zy/GameMatch.php new file mode 100644 index 0000000..047bb15 --- /dev/null +++ b/application/admin/controller/zy/GameMatch.php @@ -0,0 +1,74 @@ +model = new \app\admin\model\zy\GameMatch; + + } + + + + /** + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 + */ + + + /** + * 查看 + */ + public function index() + { + //当前是否为关联查询 + $this->relationSearch = true; + //设置过滤方法 + $this->request->filter(['strip_tags', 'trim']); + if ($this->request->isAjax()) { + //如果发送的来源是Selectpage,则转发到Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + list($where, $sort, $order, $offset, $limit) = $this->buildparams(); + + $list = $this->model + ->with(['stadium','club','activity','game']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('stadium')->visible(['name']); + $row->getRelation('club')->visible(['name']); + $row->getRelation('activity')->visible(['name']); + $row->getRelation('game')->visible(['name']); + } + + $result = array("total" => $list->total(), "rows" => $list->items()); + + return json($result); + } + return $this->view->fetch(); + } + +} diff --git a/application/admin/lang/zh-cn/zy/activity.php b/application/admin/lang/zh-cn/zy/activity.php index a4d4579..9832eee 100644 --- a/application/admin/lang/zh-cn/zy/activity.php +++ b/application/admin/lang/zh-cn/zy/activity.php @@ -51,6 +51,17 @@ return [ "Rule_type4" => "固搭转", "Rule_type5" => "固定擂", "Rule_type6" => "活动擂", + "Rule_type7" => "转转", + "Rule_type8" => "分区转", + "Rule_type9" => "擂台赛", + "Rule_type10" => "守擂赛", + "Rule_type11" => "追分赛", + "Rule_type12" => "固搭追分赛", + "Rule_type13" => "大循环群内赛", + "Rule_type14" => "两队PK赛", + "Rule_type15" => "战队淘汰赛", + "Rule_type16" => "单项淘汰赛", + "Rule_type17" => "分区循环淘汰赛", "Type0" => "一次性", "Type1" => "周期性", diff --git a/application/admin/lang/zh-cn/zy/game.php b/application/admin/lang/zh-cn/zy/game.php index 3078f59..9a024bf 100644 --- a/application/admin/lang/zh-cn/zy/game.php +++ b/application/admin/lang/zh-cn/zy/game.php @@ -56,6 +56,18 @@ return [ "Rule_type4" => "固搭转", "Rule_type5" => "固定擂", "Rule_type6" => "活动擂", + "Rule_type7" => "转转", + "Rule_type8" => "分区转", + "Rule_type9" => "擂台赛", + "Rule_type10" => "守擂赛", + "Rule_type11" => "追分赛", + "Rule_type12" => "固搭追分赛", + "Rule_type13" => "大循环群内赛", + "Rule_type14" => "两队PK赛", + "Rule_type15" => "战队淘汰赛", + "Rule_type16" => "单项淘汰赛", + "Rule_type17" => "分区循环淘汰赛", + "Type0" => "一次性", "Type1" => "周期性", diff --git a/application/admin/lang/zh-cn/zy/game_match.php b/application/admin/lang/zh-cn/zy/game_match.php new file mode 100644 index 0000000..ea5dccc --- /dev/null +++ b/application/admin/lang/zh-cn/zy/game_match.php @@ -0,0 +1,25 @@ + '球馆', + 'Club_id' => '俱乐部', + 'Act_id' => '活动', + 'Game_id' => '比赛', + 'Level' => '轮次', + 'Turn' => '场次', + 'TeamA' => '甲方队员', + 'TeamB' => '乙方队员', + 'Round1' => '第一局比分 +', + 'Round2' => '第二局比分', + 'Round3' => '第三局比分', + 'ScoreA' => '甲方总得分', + 'ScoreB' => '乙方总得分', + 'Winner' => '胜队', + 'Create_time' => '创建时间', + 'Update_time' => '修改时间', + 'Stadium.name' => '球馆名称', + 'Club.name' => '俱乐部名称', + 'Activity.name' => '活动名称', + 'Game.name' => '赛事名称' +]; diff --git a/application/admin/model/zy/GameMatch.php b/application/admin/model/zy/GameMatch.php new file mode 100644 index 0000000..b71215d --- /dev/null +++ b/application/admin/model/zy/GameMatch.php @@ -0,0 +1,62 @@ +belongsTo('Stadium', 'gym_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function club() + { + return $this->belongsTo('Club', 'club_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function activity() + { + return $this->belongsTo('Activity', 'act_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function game() + { + return $this->belongsTo('Game', 'game_id', 'id', [], 'LEFT')->setEagerlyType(0); + } +} diff --git a/application/admin/validate/zy/GameMatch.php b/application/admin/validate/zy/GameMatch.php new file mode 100644 index 0000000..f966d93 --- /dev/null +++ b/application/admin/validate/zy/GameMatch.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/zy/game_match/add.html b/application/admin/view/zy/game_match/add.html new file mode 100644 index 0000000..2410d5f --- /dev/null +++ b/application/admin/view/zy/game_match/add.html @@ -0,0 +1,94 @@ +
diff --git a/application/admin/view/zy/game_match/edit.html b/application/admin/view/zy/game_match/edit.html new file mode 100644 index 0000000..350aeb7 --- /dev/null +++ b/application/admin/view/zy/game_match/edit.html @@ -0,0 +1,94 @@ + diff --git a/application/admin/view/zy/game_match/index.html b/application/admin/view/zy/game_match/index.html new file mode 100644 index 0000000..af91c00 --- /dev/null +++ b/application/admin/view/zy/game_match/index.html @@ -0,0 +1,29 @@ +