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, ]; }