feat(俱乐部): 增加俱乐部详细介绍和关注数功能

This commit is contained in:
2025-05-18 20:20:01 +08:00
parent 55af3cb570
commit c3b0a47e6d
6 changed files with 102 additions and 5 deletions

5
add.sql Normal file
View File

@@ -0,0 +1,5 @@
ALTER TABLE `zy_club` ADD COLUMN `intro` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '介绍' AFTER `blurb`;
ALTER TABLE `zy_club` ADD COLUMN `contect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系方式' AFTER `img`;
ALTER TABLE `zy_club` ADD COLUMN `attention` int(11) NOT NULL DEFAULT 0 COMMENT '关注人数' AFTER `contect`;
-- 已执行 2025-05-18

View File

@@ -144,8 +144,14 @@ class Activity extends Base
Db::startTrans(); Db::startTrans();
try { try {
$params = $this->request->param(); $params = $this->request->param();
$game = Game::where('id', $params['act_id'] ?? NULL) if (isset($params['game_id'])) {
->where('date', $params['date'] ?? NULL)->find(); $game = Game::get($params['game_id']);
} else {
$game = Game::where('id', $params['act_id'] ?? NULL)
->where('week', $params['week'] ?? NULL)
->where('date', $params['date'] ?? NULL)
->find();
}
if (empty($game)) { if (empty($game)) {
$this->error('活动不存在'); $this->error('活动不存在');
} }

View File

@@ -69,4 +69,53 @@ class Game extends Base
$this->success('Success', $model); $this->success('Success', $model);
} }
public function getMacth()
{
$params = $this->request->param();
$game = $this->model->get($params['id'] ?? NULL);
if (empty($game)) {
$this->error('比赛不存在');
}
$participant = Participant::where('game_id', $game['id'])->where('status', 1)->select();
if ($game['team_type'] == 1) { //双打
// 转转 4-16 每个人与其他人各搭档1次决出个人排名 人数 4 ≦ n ≦ 16 (Default8)
// 轮数 3 ≦ mn (Default7) 报名费 0 ≦ m ≦ 10 元 (Default: 5)
// 由前几名按比例瓜分 (可调 Default40%/30%/20%/10%)
// 混双转 4-32
// (偶数) 每男与每女各搭档1次分别决出男女排名 人数 4 ≦ n ≦ 32 (Default16)
// 轮数2 ≦ m ≦ n/2 (Default8) 报名费 0 ≦ m ≦ 10 元 (Default: 5)
// 由前几名按比例瓜分 (可调 Default40%/30%/20%/10%)
// 固搭转 4-32
// (偶数) 固定组合,分别与其他组合对战一次,决出组合排名 人数 4 ≦ n ≦ 32 (Default16)
// 轮数 2 ≦ m ≦ n/2-1 (Default7) 报名费 0 ≦ m ≦ 10 元 (Default: 5)
// 由前几名按比例瓜分 (可调 Default40%/30%/20%/10%)
// 分区转 4-32
// (偶数) 分为AB两区A区与B区各搭档1次分别决出AB区排名 人数 4 ≦ n ≦ 32 (Default16)
// 轮数2 ≦ m ≦ n/2 (Default8) 报名费 0 ≦ m ≦ 10 元 (Default: 5)
// 由前几名按比例瓜分 (可调 Default40%/30%/20%/10%)
// 擂台赛 8-44 由擂主决定出战组合,攻擂者按组合报名(不重复报名,但可兼项) 擂主人数 2 ≦ k ≦ 4 (Default2)
// 总攻擂数4 ≦ n ≦ 5k(Default8) 攻擂报名费 0 ≦ m ≦ 10 (Default5)
// 擂主报名费 2n/k (不可调)
// 攻擂者赢局获得2m元(不可调)
// 由擂主分摊盈亏
// 守擂赛 4-32
// (偶数) 选手组合报名不可重复报名抽签决定对战顺序相邻顺序对战连赢m局进入决赛决赛为淘汰赛决出冠亚季 人数 4 ≦ n ≦ 32 (Default16)
// 连赢 1 ≦ m ≦ 3 (Default2) 报名费0 ≦ k ≦ 10 (Default5)
// 由前几名按比例瓜分 (可调 Default40%/30%/20%/10%)
if ($game['rule_type'] == 1) { //转转
foreach ($participant as $key => $value) {
}
}
} elseif ($game['team_type'] == 2) { //单打
} elseif ($game['team_type'] == 3) { //团队
}
$this->success('Success', ['list' => $participant]);
}
} }

View File

@@ -5,13 +5,16 @@ return [
'Name' => '俱乐部名称', 'Name' => '俱乐部名称',
'Sub_name' => '简称', 'Sub_name' => '简称',
'Logo' => 'logo', 'Logo' => 'logo',
'Contect' => '联系方式',
'City' => '常住地', 'City' => '常住地',
'Blurb' => '简介', 'Blurb' => '简介',
'Intro' => '详细介绍',
'Join_type' => '入会方式', 'Join_type' => '入会方式',
'Img' => '图片', 'Img' => '图片',
'President' => '会长', 'President' => '会长',
'Admin_ids' => '管理员', 'Admin_ids' => '管理员',
'Tags' => '标签', 'Tags' => '标签',
'attention' => '关注数',
'Is_public' => '是否公开', 'Is_public' => '是否公开',
'Create_time' => '创建时间', 'Create_time' => '创建时间',
'Update_time' => '修改时间', 'Update_time' => '修改时间',

View File

@@ -38,6 +38,13 @@
</div> </div>
<ul class="row list-inline faupload-preview" id="p-logo"></ul> <ul class="row list-inline faupload-preview" id="p-logo"></ul>
</div> </div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Contect')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-contect" data-rule="required" class="form-control" name="row[contect]" type="text"
value="">
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
@@ -51,6 +58,13 @@
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">
<textarea id="c-blurb" class="form-control " rows="5" name="row[blurb]" cols="50"></textarea> <textarea id="c-blurb" class="form-control " rows="5" name="row[blurb]" cols="50"></textarea>
</div> </div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Intro')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-intro" class="form-control editor" rows="5" name="row[intro]"
cols="50"></textarea>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Join_type')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('Join_type')}:</label>

View File

@@ -41,6 +41,13 @@
<ul class="row list-inline faupload-preview" id="p-logo"></ul> <ul class="row list-inline faupload-preview" id="p-logo"></ul>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Contect')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-contect" data-rule="required" class="form-control" name="row[contect]" type="text"
value="{$row.contect|htmlentities}">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">
@@ -55,6 +62,13 @@
cols="50">{$row.blurb|htmlentities}</textarea> cols="50">{$row.blurb|htmlentities}</textarea>
</div> </div>
</div> </div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Intro')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-intro" class="form-control editor" rows="5" name="row[intro]"
cols="50">{$row.intro|htmlentities}</textarea>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Join_type')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('Join_type')}:</label>
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">
@@ -92,9 +106,15 @@
<div class="form-group"> <div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Admin_ids')}:</label> <label class="control-label col-xs-12 col-sm-2">{:__('Admin_ids')}:</label>
<div class="col-xs-12 col-sm-8"> <div class="col-xs-12 col-sm-8">
<input id="c-admin_ids" data-source="user/user/index" data-field="nickname" <input id="c-admin_ids" data-source="user/user/index" data-field="nickname" data-multiple="true"
data-multiple="true" class="form-control selectpage" name="row[admin_ids]" type="text" class="form-control selectpage" name="row[admin_ids]" type="text" value="{$row.admin_ids|htmlentities}">
value="{$row.admin_ids|htmlentities}"> </div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Attention')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-attention" class="form-control" name="row[attention]" type="number"
value="{$row.attention|htmlentities}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">