perf: 优化流量消费相关代码性能,解决流量纪录与已用流量有概率不一致的问题

This commit is contained in:
xboard committed 2024-04-27 17:06:57 +08:00
1 parent bd9873e5ad
commit 7faa7ccdf0
12 files changed
+246 -171

No files matched your search

@@ -24,7 +24,6 @@ class StatController extends Controller
$recordAt = strtotime(date('Y-m-d'));
$statService = new StatisticalService();
$statService->setStartAt($recordAt);
$statService->setUserStats();
$todayTraffics = $statService->getStatUserByUserID($request->user['id']);
if (count($todayTraffics) > 0) {
$todayTraffics = collect($todayTraffics)->map(function ($todayTraffic) {