fix: 修复流量明细显示所有记录的BUG

This commit is contained in:
xboard 2024-10-07 09:55:19 +08:00
parent 2f29c5f118
commit af1f1e9fdf

View File

@ -13,7 +13,7 @@ class StatController extends Controller
{ {
public function getTrafficLog(Request $request) public function getTrafficLog(Request $request)
{ {
$startDate = now()->startOfMonth(); $startDate = now()->startOfMonth()->timestamp;
$records = StatUser::query() $records = StatUser::query()
->where('user_id', $request->user['id']) ->where('user_id', $request->user['id'])
->where('record_at', '>=', $startDate) ->where('record_at', '>=', $startDate)