zx/crmeb/listens/CreateOperateLogListen.php

21 lines
598 B
PHP
Raw Permalink Normal View History

2024-07-02 15:32:59 +08:00
<?php
namespace crmeb\listens;
use app\common\repositories\system\operate\OperateLogRepository;
use crmeb\interfaces\ListenerInterface;
use think\facade\Log;
class CreateOperateLogListen implements ListenerInterface
{
public function handle($event): void
{
try {
app()->make(OperateLogRepository::class)->recordLog($event['category'], $event['data'], $event['mer_id'] ?? 0);
} catch (\Throwable $throwable) {
Log::error(['message' => $throwable->getMessage(), 'file' => $throwable->getFile(), 'line' => $throwable->getLine()]);
}
}
}