Files
ulthon_admin/extend/base/common/event/NoticeSended/LogEventBase.php

21 lines
561 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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'))),
]);
}
}