|
...
|
...
|
@@ -56,7 +56,7 @@ class WeekProject extends Command |
|
|
|
$this->weekData($v);
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
|
|
echo date('Y-m-d H:i:s') . 'end:' . PHP_EOL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
...
|
...
|
@@ -77,14 +77,14 @@ class WeekProject extends Command |
|
|
|
// 上一周的结束时间(周日 23:59:59)
|
|
|
|
$endOfLastWeek = strtotime("last week sunday 23:59:59");
|
|
|
|
// 格式化为日期时间字符串
|
|
|
|
$startOfLastWeekFormatted = date('Y-m-d', $startOfLastWeek);
|
|
|
|
$endOfLastWeekFormatted = date('Y-m-d', $endOfLastWeek);
|
|
|
|
$data['start_date'] = $startOfLastWeekFormatted = date('Y-m-d', $startOfLastWeek);
|
|
|
|
$data['end_date'] = $endOfLastWeekFormatted = date('Y-m-d', $endOfLastWeek);
|
|
|
|
$countModel = new Count();
|
|
|
|
$startOfLastWeekFormattedInfo = $countModel->read(['date'=>$startOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']);
|
|
|
|
$endOfLastWeekFormattedInfo = $countModel->read(['date'=>$endOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num']);
|
|
|
|
$data['inquiry_total'] = $startOfLastWeekFormattedInfo['inquiry_num'] ?? 0;//询盘数量
|
|
|
|
$data['inquiry_country'] = $startOfLastWeekFormattedInfo['country'] ?? json_encode([]);
|
|
|
|
$data['week_inquiry_total'] = ($startOfLastWeekFormattedInfo['inquiry_num'] ?? 0) - ($endOfLastWeekFormattedInfo['inquiry_num'] ?? 0);
|
|
|
|
$endOfLastWeekFormattedInfo = $countModel->read(['date'=>$endOfLastWeekFormatted,'project_id'=>$value['id']],['inquiry_num','country']);
|
|
|
|
$data['inquiry_total'] = $endOfLastWeekFormattedInfo['inquiry_num'] ?? 0;//询盘数量
|
|
|
|
$data['inquiry_country'] = $endOfLastWeekFormattedInfo['country'] ?? json_encode([]);
|
|
|
|
$data['week_inquiry_total'] = ($endOfLastWeekFormattedInfo['inquiry_num'] ?? 0) - ($startOfLastWeekFormattedInfo['inquiry_num'] ?? 0);
|
|
|
|
$rankDataModel = new RankData();
|
|
|
|
$rankInfo = $rankDataModel->read(['project_id'=>$value['id'],'lang'=>''],['first_num','first_page_num','first_three_pages_num','first_five_pages_num','first_ten_pages_num','indexed_pages_num']);
|
|
|
|
$data['google_indexed_num'] = $rankInfo['indexed_pages_num'] ?? 0;
|
|
...
|
...
|
@@ -108,7 +108,8 @@ class WeekProject extends Command |
|
|
|
$data['aggregation_minor_update_num'] = $notifyModel->counts(['type'=>2,'route'=>4,'project_id'=>$value['id']]) ?? 0;
|
|
|
|
//日均访问量
|
|
|
|
$data['daily_average_num'] = 0;
|
|
|
|
$pv_num_count = $countModel->whereBetween('date', [$startOfLastWeekFormatted,$endOfLastWeekFormattedInfo])->sum('pv_num');
|
|
|
|
$pv_num_count = $countModel->where('project_id',$value['id'])->whereBetween('date', [$startOfLastWeekFormatted,$endOfLastWeekFormatted])->sum('pv_num');
|
|
|
|
echo date('Y-m-d H:i:s') . 'pv总量:'.$pv_num_count . PHP_EOL;
|
|
|
|
if($pv_num_count != 0){
|
|
|
|
$data['daily_average_num'] = round($pv_num_count / 7,2);
|
|
|
|
}
|
...
|
...
|
|