From 0cbccbdd162b9fe1817cd3b3af5c1188a40803d7 Mon Sep 17 00:00:00 2001 From: huangguancheng Date: Fri, 10 Jan 2025 11:10:10 +0800 Subject: [PATCH] fixed3 --- app/service/AdsInsightService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/service/AdsInsightService.php b/app/service/AdsInsightService.php index b334da7..ab5a324 100644 --- a/app/service/AdsInsightService.php +++ b/app/service/AdsInsightService.php @@ -613,7 +613,8 @@ class AdsInsightService $aggregatedUsers[$userId]['conversion_rate'] = $total_impressions == 0 ? '-' : round(($total_clicks / $total_impressions) * 100, 2) . '%'; $aggregatedUsers[$userId]['ctr'] = $total_impressions == 0 ? '-' : round(($total_clicks / $total_impressions) * 100, 2) . '%'; } - + // 使用 array_values 移除键名 + $dataWithoutKeys = array_values($aggregatedUsers); // 最终分页信息 $pagination = [ 'startIndex' => ($page - 1) * $pageSize, @@ -627,7 +628,7 @@ class AdsInsightService return [ 'pagination' => $pagination, 'statistics' => $statistics, - 'data' => $aggregatedUsers, + 'data' => $dataWithoutKeys, ]; }