diff --git a/application/admin/controller/zy/Participant.php b/application/admin/controller/zy/Participant.php new file mode 100644 index 0000000..5ca75a7 --- /dev/null +++ b/application/admin/controller/zy/Participant.php @@ -0,0 +1,73 @@ +model = new \app\admin\model\zy\Participant; + + } + + + + /** + * 默认生成的控制器所继承的父类中有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(['user','join','game']) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + + foreach ($list as $row) { + + $row->getRelation('user')->visible(['username']); + $row->getRelation('join')->visible(['id']); + $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/participant.php b/application/admin/lang/zh-cn/zy/participant.php new file mode 100644 index 0000000..5a9c83f --- /dev/null +++ b/application/admin/lang/zh-cn/zy/participant.php @@ -0,0 +1,30 @@ + '用户id', + 'Name' => '用户名', + 'Avatar' => '头像', + 'Gender' => '性别', + 'Game_join_id' => '报名id', + 'Game_id' => '赛事id', + 'Team' => '战队', + 'Order' => '排序', + 'Rank' => '排名', + 'Mark' => '说明/备注', + 'Status' => '状态', + 'Signin' => '签到状态', + 'Score' => '得分', + 'Net_score' => '净得分', + 'Win' => '胜局', + 'Create_time' => '创建时间', + 'Update_time' => '修改时间', + 'User.username' => '用户名', + 'Game.name' => '赛事名称', + + "Status0" => "候补", + "Status1" => "已报名", + "Status2" => "退坑", + + "Signin0" => "未签到", + "Signin1" => "已签到", +]; diff --git a/application/admin/model/zy/Participant.php b/application/admin/model/zy/Participant.php new file mode 100644 index 0000000..863585f --- /dev/null +++ b/application/admin/model/zy/Participant.php @@ -0,0 +1,56 @@ +belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0); + } + + + public function join() + { + return $this->belongsTo('app\admin\model\zy\GameJoin', 'game_join_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/Participant.php b/application/admin/validate/zy/Participant.php new file mode 100644 index 0000000..2a2b754 --- /dev/null +++ b/application/admin/validate/zy/Participant.php @@ -0,0 +1,27 @@ + [], + 'edit' => [], + ]; + +} diff --git a/application/admin/view/zy/participant/add.html b/application/admin/view/zy/participant/add.html new file mode 100644 index 0000000..a0ef011 --- /dev/null +++ b/application/admin/view/zy/participant/add.html @@ -0,0 +1,108 @@ +
diff --git a/application/admin/view/zy/participant/edit.html b/application/admin/view/zy/participant/edit.html new file mode 100644 index 0000000..e20db6e --- /dev/null +++ b/application/admin/view/zy/participant/edit.html @@ -0,0 +1,108 @@ + diff --git a/application/admin/view/zy/participant/index.html b/application/admin/view/zy/participant/index.html new file mode 100644 index 0000000..20a1135 --- /dev/null +++ b/application/admin/view/zy/participant/index.html @@ -0,0 +1,29 @@ +