feat: quene

This commit is contained in:
hashbro
2026-09-01 05:09:00 +08:00
parent 337bf45c79
commit e23550e820
28 changed files with 969 additions and 234 deletions
+9 -2
View File
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
use App\Jobs\RecordPageHit;
use App\Models\Channel;
use App\Models\PageVisit;
use App\Support\UserAgentParser;
@@ -43,7 +44,7 @@ class PageHitController extends Controller
$parsed = UserAgentParser::parse($ua);
$referer = $this->referer($request);
PageVisit::recordLanding([
$attrs = [
'channel_id' => $channelId,
'client_uid' => $uid,
'user_agent' => $ua !== '' ? $ua : null,
@@ -54,7 +55,13 @@ class PageHitController extends Controller
'ip' => $ip !== '' ? $ip : null,
'domain' => $domain,
'referer' => $referer,
], PageVisit::chainFromIosVersion($parsed['os'], $parsed['os_version']));
];
$chain = PageVisit::chainFromIosVersion($parsed['os'], $parsed['os_version']);
if (config('queue.default') === 'sync') {
PageVisit::recordLanding($attrs, $chain);
} else {
RecordPageHit::dispatch($attrs, $chain);
}
return $this->pixel();
}