From 55af3cb570e22363e9c7703a7a3bffe7e5529cb9 Mon Sep 17 00:00:00 2001 From: xiadc <251308692@qq.com> Date: Sun, 18 May 2025 11:44:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(zy):=20=E5=A2=9E=E5=8A=A0=E4=BF=B1?= =?UTF-8?q?=E4=B9=90=E9=83=A8=E8=AF=A6=E6=83=85=E6=8E=A5=E5=8F=A3=E5=B9=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B8=B8=E6=88=8F=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增俱乐部详情接口,包括成员性别比例和关注度统计 - 在游戏详情页面增加关注度统计 - 更新游戏活动状态文案 - 优化 dd 和 getsql 函数输出格式 --- addons/shopro/controller/zy/Club.php | 18 ++++++++++++++++++ addons/shopro/controller/zy/Game.php | 1 + .../admin/lang/zh-cn/zy/game/activity.php | 6 +++--- thinkphp/helper.php | 12 +++++++----- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/addons/shopro/controller/zy/Club.php b/addons/shopro/controller/zy/Club.php index 29598cd..cf6a07e 100644 --- a/addons/shopro/controller/zy/Club.php +++ b/addons/shopro/controller/zy/Club.php @@ -71,6 +71,24 @@ class Club extends Base $this->success('Success', ['list' => $list, 'count' => $res->total()]); } + public function view() + { + $model = $this->model->get($this->request->param('id'))->toarray(); + + if (empty($model)) { + $this->error(__('No rows were found')); + } + $menber = Menber::alias('m') + ->join([User::$tableName => 'u'], 'u.id = m.user_id') + ->where('club_id', $model['id'])->field('gender,count(*) as num')->group('u.gender') + ->column('count(*) as num','gender'); + $model['gender0'] = $menber[0] ?? 0; + $model['gender1'] = $menber[1] ?? 0; + $this->model->where('id', $model['id'])->setInc('attention'); + + $this->success('Success', $model); + } + public function add() { $result = false; diff --git a/addons/shopro/controller/zy/Game.php b/addons/shopro/controller/zy/Game.php index 76dd7f3..382fa22 100644 --- a/addons/shopro/controller/zy/Game.php +++ b/addons/shopro/controller/zy/Game.php @@ -63,6 +63,7 @@ class Game extends Base $this->error(__('No rows were found')); } + $this->model->where('id', $model['id'])->setInc('attention'); $model['cost'] = json_decode($model['cost'] ?? '[]', true); $model['referee'] = explode(',', $model['referee']); diff --git a/application/admin/lang/zh-cn/zy/game/activity.php b/application/admin/lang/zh-cn/zy/game/activity.php index 9832eee..ffd9f19 100644 --- a/application/admin/lang/zh-cn/zy/game/activity.php +++ b/application/admin/lang/zh-cn/zy/game/activity.php @@ -66,10 +66,10 @@ return [ "Type0" => "一次性", "Type1" => "周期性", - "Status0" => "未开始", + "Status0" => "发布", "Status1" => "报名中", - "Status2" => "进行中", - "Status3" => "已结束", + "Status2" => "比赛中", + "Status3" => "结束", "Week0" => "周日", "Week1" => "周一", diff --git a/thinkphp/helper.php b/thinkphp/helper.php index a43f6be..e0437be 100644 --- a/thinkphp/helper.php +++ b/thinkphp/helper.php @@ -593,13 +593,14 @@ if (!function_exists('dd')) { */ function dd(...$params) { - echo '
';
+ echo '
+ ';
foreach ($params as $p) {
print_r($p);
echo '
-
';
+ ';
}
- echo '';
+ // echo '';
die;
}
}
@@ -610,9 +611,10 @@ if (!function_exists('getsql')) {
*/
function getsql($query)
{
- echo '';
+ echo '
+ ';
print_r($query->fetchSql()->select());
- echo '';
+ // echo '';
die;
}
}