feat(zy): 添加消息通知功能并优化活动相关逻辑

- 在 Circle 控制器中添加点赞、评论和审核通知
- 在 Game 控制器中添加退坑、取消活动和发送消息功能
- 优化 Activity 控制器中的订单关联逻辑
- 更新语言包,添加新的活动状态翻译
This commit is contained in:
2025-05-26 11:03:39 +08:00
parent d48daea477
commit b7023e7ab3
7 changed files with 247 additions and 9 deletions

View File

@@ -62,6 +62,7 @@ class Test extends BaseJob
try {
$_actModel = new \app\admin\model\zy\game\Activity();
$_gameModel = new \app\admin\model\zy\game\Game();
$dateTime = date('Y-m-d H:i:s'); //当前星期
$week = date('w'); //当前星期
$current = time(); //当前时间
$activity = (clone $_actModel)::where('pid', 0)->select(); //周期性主活动
@@ -112,6 +113,15 @@ class Test extends BaseJob
$res = (clone $_gameModel)->allowField(true)->save($sub);
}
}
//处理已生成的比赛
$games = (clone $_gameModel)::where('join_start_time', '>=', $dateTime)->where('status', '<', 2)->select();
foreach ($games as $g) {
if ($g['join_start_time'] <= $dateTime && $g['join_end_time'] > $dateTime) {
$g->save(['status' => 1]); //开始报名
} elseif ($g['join_end_time'] <= $dateTime) {
$g->save(['status' => 2]); //报名截止,活动进行中
}
}
Db::commit();
} catch (ValidateException | PDOException | Exception $e) {
Db::rollback();