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

@@ -486,20 +486,20 @@ class User extends Common
'reason' => $params['reason'] ?? '',
'status' => 1
]);
(new Message())->allowField(true)->save([ // 消息通知
'type' => 2,
'name' => $fromUser->nickname,
'avatar' => $fromUser->avatar,
'from_id' => $fromUser->id,
'user_id' => $user->id,
'content' => json_encode([
'topic' => '申请联系信息',
'申请人' => $fromUser->nickname,
'申请时间' => date('Y-m-d H:i:s'),
'reason' => $params['reason'] ?? '',
'apply_id' => $apply->id
])
]);
// (new Message())->allowField(true)->save([ // 消息通知
// 'type' => 2,
// 'name' => $fromUser->nickname,
// 'avatar' => $fromUser->avatar,
// 'from_id' => $fromUser->id,
// 'user_id' => $user->id,
// 'content' => json_encode([
// 'topic' => '申请联系信息',
// '申请人' => $fromUser->nickname,
// '申请时间' => date('Y-m-d H:i:s'),
// 'reason' => $params['reason'] ?? '',
// 'apply_id' => $apply->id
// ])
// ]);
Db::commit();
} catch (ValidateException | PDOException | Exception $e) {
Db::rollback();