- Fix storage permissions to use 'www' user instead of 'www-data' - Fix UserModel getAllForAdmin query to avoid placeholders in LIMIT/OFFSET - Import missing modules: Advertising, Dashboard, Analytics - Update deploy script to copy files to public directory
26 lines
825 B
PHP
26 lines
825 B
PHP
<?php
|
|
namespace App\Modules\Advertising\Services;
|
|
|
|
use App\Core\DatabaseManager;
|
|
|
|
class AdvertisingActivityLogger
|
|
{
|
|
public static function log(string $eventType, string $entityType, int $entityId, ?int $userId = null, ?string $description = null, $meta = null): void
|
|
{
|
|
$db = DatabaseManager::getInstance();
|
|
$cuid = (string) new \Visus\Cuid2\Cuid2();
|
|
$db->query(
|
|
"INSERT INTO advertising_activity_log (cuid, event_type, entity_type, entity_id, user_id, description, meta, created_at) VALUES (?, ?, ?, ?, ?, ?, ?, NOW())",
|
|
[
|
|
$cuid,
|
|
$eventType,
|
|
$entityType,
|
|
$entityId,
|
|
$userId,
|
|
$description,
|
|
$meta ? json_encode($meta) : null
|
|
]
|
|
);
|
|
}
|
|
}
|