feat: new chain

This commit is contained in:
hashbro
2026-08-11 03:12:11 +08:00
parent 4802d0e51f
commit 8816c4d957
4 changed files with 45 additions and 11 deletions
+26 -2
View File
@@ -166,6 +166,9 @@ class DashboardStatsService
};
}
/**
* Effective traffic: Safari on iOS ≤ 17.2 (includes 17.2.x patch builds; excludes 17.3+).
*/
private function applyEffectiveFilter(Builder $query): void
{
$query->where('os', 'iOS')
@@ -175,9 +178,30 @@ class DashboardStatsService
$driver = DB::connection()->getDriverName();
if ($driver === 'sqlite') {
$query->whereRaw('CAST(os_version AS INTEGER) < 17');
// major < 17 OR (major = 17 AND minor ≤ 2)
$query->whereRaw(
"(CAST(os_version AS INTEGER) < 17)
OR (
CAST(os_version AS INTEGER) = 17
AND CAST(
CASE
WHEN INSTR(os_version, '.') > 0
THEN SUBSTR(os_version, INSTR(os_version, '.') + 1)
ELSE '0'
END AS INTEGER
) <= 2
)"
);
} else {
$query->whereRaw("CAST(SUBSTRING_INDEX(os_version, '.', 1) AS UNSIGNED) < 17");
$query->whereRaw(
"(CAST(SUBSTRING_INDEX(os_version, '.', 1) AS UNSIGNED) < 17)
OR (
CAST(SUBSTRING_INDEX(os_version, '.', 1) AS UNSIGNED) = 17
AND CAST(
SUBSTRING_INDEX(SUBSTRING_INDEX(CONCAT(os_version, '.0'), '.', 2), '.', -1) AS UNSIGNED
) <= 2
)"
);
}
}
+1 -1
View File
@@ -84,7 +84,7 @@ class DataCommand
'活跃设备: '.$data['active_count'],
'页面 PV: '.$data['effective_pv'].' / '.$data['pv'].' (有效/全部)',
'页面 UV: '.$data['effective_uv'].' / '.$data['uv'].' (有效/全部)',
'有效口径: iOS<17 + Safari',
'有效口径: iOS≤17.2 + Safari',
'',
'按系统:',
];