From 549ac512ec6f2f61e73fe1e524b381286d0421e0 Mon Sep 17 00:00:00 2001
From: huangguancheng <huangguancheng@bestfulfill>
Date: Thu, 23 Jan 2025 11:41:28 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=AD=97=E6=AE=B5=20?=
 =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=BC=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/service/AdsDashboardService.php |  8 ++++----
 app/service/AdsInsightService.php   | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/app/service/AdsDashboardService.php b/app/service/AdsDashboardService.php
index b8250b5..547c33f 100644
--- a/app/service/AdsDashboardService.php
+++ b/app/service/AdsDashboardService.php
@@ -133,7 +133,7 @@ class AdsDashboardService
                 'meta_conversion_value' => 'platform_purchase_value',
                 'web_conversion_value' => 'purchases_value',
                 'conversion_value' => 'purchases_value',
-                'cpoc' => '',
+                'cpoc' => 'cpoc',
                 'ctr' => 'ctr',
                 'revenue_per_link_click' => 'revenue_per_link_click',
                 'cpa' => 'cpa',
@@ -234,13 +234,13 @@ class AdsDashboardService
                             $value = '$' . number_format($platform_purchase_value, 2);
                             break;
                         case 'roas':
-                            $value = round($roas, 2) . 'X';
+                            $value = round($roas, 2) . 'x';
                             break;
                         case 'google_roas':
-                            $value = round($google_roas, 2) . 'X';
+                            $value = round($google_roas, 2) . 'x';
                             break;
                         case 'cpoc':
-                            $value = '$' . number_format($cpoc, 2) . '%';
+                            $value = '$' . number_format($cpoc, 2);
                             break;
                         case 'ctr':
                             $value = number_format($ctr * 100, 2) . '%';
diff --git a/app/service/AdsInsightService.php b/app/service/AdsInsightService.php
index 9e9d411..256e676 100644
--- a/app/service/AdsInsightService.php
+++ b/app/service/AdsInsightService.php
@@ -239,7 +239,7 @@ class AdsInsightService
         $statistics = [
             'platform_purchase' => array_sum(array_column($allCampaigns, 'platform_purchase')),
             'pixel_purchase' => array_sum(array_column($allCampaigns, 'pixel_purchase')),
-            'roas' => $total_spend == 0 ? '-' : round($total_revenue / $total_spend, 2) . 'X',
+            'roas' => $total_spend == 0 ? '-' : round($total_revenue / $total_spend, 2) . 'x',
             'amount_spend' => '$' . number_format($total_spend, 2) ?: '$0.00', // 格式化支出
             'clicks' => $total_clicks,
             'impressions' => $total_impressions,
@@ -285,7 +285,7 @@ class AdsInsightService
                 'status' => $item['status'],
                 'platform_purchase' => $item['platform_purchase'],
                 'pixel_purchase' => $item['pixel_purchase'],
-                'roas' => $item['spend'] == 0 ? '-' : round($item['revenue'] / $item['spend'], 2) . 'X',
+                'roas' => $item['spend'] == 0 ? '-' : round($item['revenue'] / $item['spend'], 2) . 'x',
                 'spend' => '$' . number_format($item['spend'], 2),  // 格式化支出
                 'impressions' => $item['impressions'],
                 'clicks' => $item['clicks'],
@@ -940,7 +940,7 @@ class AdsInsightService
         $statistics = [
             'platform_purchase' => array_sum(array_column($allAdsets, 'platform_purchase')),
             'pixel_purchase' => array_sum(array_column($allAdsets, 'pixel_purchase')),
-            'roas' => $total_spend == 0 ? '-' : round($total_revenue / $total_spend, 2) . 'X',
+            'roas' => $total_spend == 0 ? '-' : round($total_revenue / $total_spend, 2) . 'x',
             'amount_spend' => '$' . number_format($total_spend, 2) ?: '$0.00', // 格式化支出
             'clicks' => $total_clicks,
             'impressions' => array_sum(array_column($allAdsets, 'impressions')),
@@ -985,7 +985,7 @@ class AdsInsightService
                 'status' => $item['status'],
                 'platform_purchase' => $item['platform_purchase'],
                 'pixel_purchase' => $item['pixel_purchase'],
-                'roas' => $item['spend'] == 0 ? '-' : round($item['purchases_value'] / $item['spend'], 2) . 'X',
+                'roas' => $item['spend'] == 0 ? '-' : round($item['purchases_value'] / $item['spend'], 2) . 'x',
                 'spend' => '$' . number_format($item['spend'], 2),  // 格式化支出
                 'impressions' => $item['impressions'],
                 'clicks' => $item['clicks'],
@@ -1947,7 +1947,7 @@ class AdsInsightService
         $statistics = [
             'spend' => '$' . number_format($statisticsData['spend'], 2),  // 格式化金额
             'purchases_value' => '$' . number_format($statisticsData['purchases_value'], 2),  // 格式化金额
-            'roas' => $statisticsData['spend'] == 0 ? '-' : round($statisticsData['purchases_value'] / $statisticsData['spend'], 2) . 'X',
+            'roas' => $statisticsData['spend'] == 0 ? '-' : round($statisticsData['purchases_value'] / $statisticsData['spend'], 2) . 'x',
             'cpa' => $statisticsData['purchases'] == 0 ? '-' : '$' . number_format($statisticsData['spend'] / $statisticsData['purchases'], 2),
             'cpc_link_click' => $statisticsData['link_clicks'] == 0 ? '-' : '$' . number_format($statisticsData['spend'] / $statisticsData['link_clicks'], 2),
             'cpm' => $statisticsData['impressions'] == 0 ? '-' : '$' . number_format($statisticsData['spend'] * 1000 / $statisticsData['impressions'], 2), // sum(spend) * 1000 / sum(Impression)
@@ -2017,7 +2017,7 @@ class AdsInsightService
                 'thumbnail_url' => $item['thumbnail_url'],
                 'spend' => '$' . number_format($item['spend'], 2),
                 'purchases_value' => '$' . number_format($item['purchases_value'], 2),
-                'roas' => $item['spend'] == 0 ? '-' : round($item['purchases_value'] / $item['spend'], 2) . 'X',
+                'roas' => $item['spend'] == 0 ? '-' : round($item['purchases_value'] / $item['spend'], 2) . 'x',
                 'cpa' => $item['purchases'] == 0 ? '-' : '$' . number_format($item['spend'] / $item['purchases'], 2),
                 'cpc_link_click' => $item['link_clicks'] == 0 ? '-' : '$' . number_format($item['spend'] / $item['link_clicks'], 2),
                 'cpm' => $item['impressions'] == 0 ? '-' : '$' . number_format($item['spend'] * 1000 / $item['impressions'], 2),