mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-11-08 03:50:50 +08:00
feat(notice): NoticeSended 事件与登录提醒内置监听
This commit is contained in:
20
extend/base/common/event/NoticeSended/LogEventBase.php
Normal file
20
extend/base/common/event/NoticeSended/LogEventBase.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace base\common\event\NoticeSended;
|
||||
|
||||
use think\facade\Log;
|
||||
|
||||
class LogEventBase
|
||||
{
|
||||
public function handle(array $payload)
|
||||
{
|
||||
// 事件监听处理:payload = [$notice(模型), $targets(投递行数组)](NoticeServiceBase::send trigger 形态)
|
||||
[$notice, $targets] = $payload;
|
||||
|
||||
Log::info('notice sended', [
|
||||
'notice_id' => (int) $notice->id,
|
||||
'target_count' => count($targets),
|
||||
'channels' => array_values(array_unique(array_column($targets, 'channel'))),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user