This commit is contained in:
toom1996
2025-06-27 12:29:44 +08:00
parent ac92de4508
commit b9568ceb18

View File

@ -273,23 +273,23 @@ class KeywordsController extends AbstractController
$exportList = [];
// 百度PC负面率
$total = AppKeywordsMonitorTask::query()->where('is_delete', 0)->where('platform', 1)->sum('length') ?: 1;
$percent = round(count($baiduPCRes) / $total, 2) * 100;
$exportList["百度PC端_$percent%"] = $baiduPCRes;
// $percent = round(count($baiduPCRes) / $total, 2) * 100;
$exportList["百度PC端"] = $baiduPCRes;
// 百度WAP负面率
$total = AppKeywordsMonitorTask::query()->where('is_delete', 0)->where('platform', 2)->sum('length') ?: 1;
$percent = round(count($baiduWAPRes) / $total, 2) * 100;
$exportList["百度WAP端_$percent%"] = $baiduWAPRes;
// $percent = round(count($baiduWAPRes) / $total, 2) * 100;
$exportList["百度WAP端"] = $baiduWAPRes;
// 头条PC端负面率
$total = AppKeywordsMonitorTask::query()->where('is_delete', 0)->where('platform', 3)->sum('length') ?: 1;
$percent = round(count($toutiaoPC) / $total, 2) * 100;
$exportList["头条PC端_$percent%"] = $toutiaoPC;
// $percent = round(count($toutiaoPC) / $total, 2) * 100;
$exportList["头条PC端"] = $toutiaoPC;
// 头条WAP端负面率
$total = AppKeywordsMonitorTask::query()->where('is_delete', 0)->where('platform', 4)->sum('length') ?: 1;
$percent = round(count($toutiaoWAP) / $total, 2) * 100;
$exportList["头条WAP端_$percent%"] = $toutiaoWAP;
// $percent = round(count($toutiaoWAP) / $total, 2) * 100;
$exportList["头条WAP端"] = $toutiaoWAP;
return ExcelHelper::exportData($this->response, list: $exportList, header: [
['关键词', 'keyword', 'text'],