refactor(zy): 修改消息通知的类型和功能

This commit is contained in:
2025-06-09 10:52:18 +08:00
parent c9a8b9d5e8
commit 70baaa2fd5
5 changed files with 127 additions and 109 deletions

View File

@@ -223,20 +223,20 @@ class Club extends Base
'reason' => $params['reason'],
'status' => 1
]);
(new Message())->allowField(true)->save([ // 消息通知
'type' => 3,
'name' => $club->name,
'avatar' => $club->logo,
'from_id' => $club->id,
'content' => json_encode([
'topic' => '俱乐部加入申请',
'俱乐部名称' => $club->name,
'申请人' => $this->user->nickname,
'申请时间' => date('Y-m-d H:i:s'),
'reason' => $params['reason'] ?? '',
'apply_id' => $apply->id
])
]);
// (new Message())->allowField(true)->save([ // 消息通知
// 'type' => 3,
// 'name' => $club->name,
// 'avatar' => $club->logo,
// 'from_id' => $club->id,
// 'content' => json_encode([
// 'topic' => '俱乐部加入申请',
// '俱乐部名称' => $club->name,
// '申请人' => $this->user->nickname,
// '申请时间' => date('Y-m-d H:i:s'),
// 'reason' => $params['reason'] ?? '',
// 'apply_id' => $apply->id
// ])
// ]);
}
Db::commit();
} catch (ValidateException | PDOException | Exception $e) {
@@ -296,20 +296,20 @@ class Club extends Base
'reason' => $params['reason'],
'status' => 1
]);
(new Message())->allowField(true)->save([ // 消息通知
'type' => 3,
'name' => $club->name,
'avatar' => $club->logo,
'from_id' => $club->id,
'content' => json_encode([
'topic' => '俱乐部加入申请',
'俱乐部名称' => $club->name,
'申请人' => $user->nickname,
'申请时间' => date('Y-m-d H:i:s'),
'reason' => $params['reason'] ?? '',
'apply_id' => $apply->id,
])
]);
// (new Message())->allowField(true)->save([ // 消息通知
// 'type' => 3,
// 'name' => $club->name,
// 'avatar' => $club->logo,
// 'from_id' => $club->id,
// 'content' => json_encode([
// 'topic' => '俱乐部加入申请',
// '俱乐部名称' => $club->name,
// '申请人' => $user->nickname,
// '申请时间' => date('Y-m-d H:i:s'),
// 'reason' => $params['reason'] ?? '',
// 'apply_id' => $apply->id,
// ])
// ]);
}
Db::commit();
} catch (ValidateException | PDOException | Exception $e) {