feat(user): 添加用户申请联系功能并优化俱乐部相关操作

- 新增用户申请联系信息功能,包括申请、审核和处理流程
- 优化俱乐部申请、邀请和处理申请的逻辑
- 修复活动不存在时的错误提示
- 优化活动查询条件,支持一次性活动的特殊处理
This commit is contained in:
2025-05-04 17:23:11 +08:00
parent 98eda4e5ff
commit c76019416a
4 changed files with 272 additions and 116 deletions

View File

@@ -5,8 +5,9 @@ namespace addons\shopro\controller\zy;
use think\Db;
use think\Cache;
use think\Exception;
use app\admin\model\zy\game\Game;
use think\exception\PDOException;
use addons\shopro\library\RedisCache;
use app\admin\model\zy\game\GameJoin;
use think\exception\ValidateException;
use addons\shopro\service\order\OrderCreate;
@@ -87,10 +88,13 @@ class Activity extends Base
Db::startTrans();
try {
$params = $this->request->param();
$game = \app\admin\model\zy\game\Game::where('id', $params['act_id'] ?? NULL)
$game = Game::where('id', $params['act_id'] ?? NULL)
->where('date', $params['date'] ?? NULL)->find();
if (empty($game)) {
$this->error(__('No rows were found'));
$this->error('活动不存在');
}
if ($game['join_start_time'] > date('Y-m-d H:i:s')) {
$this->error('活动报名时间未开始');
}
$this->svalidate($params, ".create");
@@ -98,7 +102,7 @@ class Activity extends Base
$result = $orderCreate->calc('create');
$order = $orderCreate->create($result);
$join = new \app\admin\model\zy\game\GameJoin;
$join = new GameJoin;
$join->allowField(true)->save([
'act_id' => $game['act_id'],
'game_id' => $game['id'],
@@ -113,6 +117,7 @@ class Activity extends Base
Db::rollback();
$this->error($e->getMessage(), $e);
}
$this->success('Success', $join);
}
}