feat(消息模块): 优化消息查询逻辑,支持俱乐部消息展示
- 修改了 User、Activity、Circle、Club 和 Game 控制器中的消息查询逻辑 - 增加了对俱乐部成员的判断,使得俱乐部消息能够展示给相关用户 - 调整了消息表中的字段名称,统一使用 user_id 替代 target_id - 优化了订单创建流程,只在需要时创建订单 - 更新了活动模型中的 costKey 属性,以适应新的费用结构 - 添加了新的费用类型翻译,以支持多退少补等功能
This commit is contained in:
@@ -235,18 +235,21 @@ class Activity extends Base
|
||||
$this->error('报名人数错误');
|
||||
}
|
||||
}
|
||||
$orderCreate = new OrderCreate($params);
|
||||
$result = $orderCreate->calc('create');
|
||||
$order = $orderCreate->create($result);
|
||||
$join = new GameJoin;
|
||||
$join->allowField(true)->save([
|
||||
'act_id' => $game['act_id'],
|
||||
'game_id' => $game['id'],
|
||||
'user_id' => $this->auth->id,
|
||||
'order_id' => $order['id'],
|
||||
'status' => 0, //待支付
|
||||
'users' => json_encode($params['users'] ?? [])
|
||||
]);
|
||||
$cost = json_decode($game['cost'], true);
|
||||
if (!empty($cost['type']) && ($cost['type'] == 10 || $cost['type'] == 30)) {
|
||||
$orderCreate = new OrderCreate($params);
|
||||
$result = $orderCreate->calc('create');
|
||||
$order = $orderCreate->create($result);
|
||||
$join = new GameJoin;
|
||||
$join->allowField(true)->save([
|
||||
'act_id' => $game['act_id'],
|
||||
'game_id' => $game['id'],
|
||||
'user_id' => $this->auth->id,
|
||||
'order_id' => $order['id'],
|
||||
'status' => 0, //待支付
|
||||
'users' => json_encode($params['users'] ?? [])
|
||||
]);
|
||||
}
|
||||
foreach ($participant as &$p) {
|
||||
$p['game_join_id'] = $join->id;
|
||||
}
|
||||
@@ -258,6 +261,6 @@ class Activity extends Base
|
||||
$this->error($e->getMessage(), $e);
|
||||
}
|
||||
|
||||
$this->success('Success', $order);
|
||||
$this->success('Success', $order ?? []);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user