作者 lyh

gx

... ... @@ -83,7 +83,7 @@ class OptimizationReportController extends BaseController
'data' => array_values($indexed_pages['data'] ?? []),
];
//月统计报告
$data['month_count'] = $this->currentMonthCount();
$data['month_count'] = $this->currentMonthCount($domain_info['domain'],$this->param['project_id']);
//测速
$speed = Speed::where('project_id', $this->param['project_id'])->first();
$data['speed'] = $speed['data'] ?? [];
... ... @@ -100,15 +100,15 @@ class OptimizationReportController extends BaseController
* @method :post
* @time :2023/7/3 9:55
*/
public function currentMonthCount(){
public function currentMonthCount($domain,$project_id){
// 获取当前月的开始时间
$startTime = date('Y-m-01 00:00:00', strtotime('2024-01'));
// 获取当前月的结束时间
$endTime = date('Y-m-t 23:59:59', strtotime('2024-01'));
$arr = [];
$arr = $this->inquiryCount($arr,$startTime,$endTime,$this->user['domain']);
$arr = $this->flowCount($arr,$startTime,$endTime,$this->user['project_id']);
$arr = $this->sourceCount($arr,$startTime,$endTime,$this->user['domain']);
$arr = $this->inquiryCount($arr,$startTime,$endTime,$domain);
$arr = $this->flowCount($arr,$startTime,$endTime,$project_id);
$arr = $this->sourceCount($arr,$startTime,$endTime,$domain);
$arr['month'] = date('Y-m',time());
return $arr;
}
... ...