作者 lyh

gx

@@ -61,7 +61,7 @@ class countProject extends Command @@ -61,7 +61,7 @@ class countProject extends Command
61 $sheet->setCellValue('N1', '上线最慢'); 61 $sheet->setCellValue('N1', '上线最慢');
62 $sheet->setCellValue('O1', '平均上线天数'); 62 $sheet->setCellValue('O1', '平均上线天数');
63 $rowCount = 2; 63 $rowCount = 2;
64 - $allData = $this->countAll(); 64 +// $allData = $this->countAll();
65 foreach ($data as $v) { 65 foreach ($data as $v) {
66 $sheet->setCellValue('A' . $rowCount, $v['month']); 66 $sheet->setCellValue('A' . $rowCount, $v['month']);
67 $sheet->setCellValue('B' . $rowCount, $v['start']); 67 $sheet->setCellValue('B' . $rowCount, $v['start']);
@@ -69,15 +69,15 @@ class countProject extends Command @@ -69,15 +69,15 @@ class countProject extends Command
69 $sheet->setCellValue('D' . $rowCount, $v['month_create_project_count']); 69 $sheet->setCellValue('D' . $rowCount, $v['month_create_project_count']);
70 $sheet->setCellValue('E' . $rowCount, $v['month_project_go_online_count']); 70 $sheet->setCellValue('E' . $rowCount, $v['month_project_go_online_count']);
71 $sheet->setCellValue('F' . $rowCount, $v['month_project_online_rate']); 71 $sheet->setCellValue('F' . $rowCount, $v['month_project_online_rate']);
72 - $sheet->setCellValue('G' . $rowCount, $allData['count']);  
73 - $sheet->setCellValue('H' . $rowCount, $allData['go_online_count']);  
74 - $sheet->setCellValue('I' . $rowCount, $allData['promotion_web_count']);  
75 - $sheet->setCellValue('J' . $rowCount, $allData['create_web_count']);  
76 - $sheet->setCellValue('K' . $rowCount, $allData['no_go_oline_count']);  
77 - $sheet->setCellValue('L' . $rowCount, $allData['delete_project_count']);  
78 - $sheet->setCellValue('M' . $rowCount, $allData['min_project_count']);  
79 - $sheet->setCellValue('N' . $rowCount, $allData['max_project_count']);  
80 - $sheet->setCellValue('O' . $rowCount, $allData['average']); 72 + $sheet->setCellValue('G' . $rowCount, $v['count']);
  73 + $sheet->setCellValue('H' . $rowCount, $v['go_online_count']);
  74 + $sheet->setCellValue('I' . $rowCount, $v['promotion_web_count']);
  75 + $sheet->setCellValue('J' . $rowCount, $v['create_web_count']);
  76 + $sheet->setCellValue('K' . $rowCount, $v['no_go_oline_count']);
  77 + $sheet->setCellValue('L' . $rowCount, $v['delete_project_count']);
  78 + $sheet->setCellValue('M' . $rowCount, $v['min_project_count']);
  79 + $sheet->setCellValue('N' . $rowCount, $v['max_project_count']);
  80 + $sheet->setCellValue('O' . $rowCount, $v['average']);
81 $rowCount++; 81 $rowCount++;
82 } 82 }
83 // 创建一个新的 Excel Writer 对象 83 // 创建一个新的 Excel Writer 对象
@@ -159,19 +159,19 @@ class countProject extends Command @@ -159,19 +159,19 @@ class countProject extends Command
159 $data[$v]['month_project_go_online_count'] = $projectModel->counts(['uptime'=>['between',[$start_time,$end_time]],'deleted_at'=>0]);//当月上线项目数量 159 $data[$v]['month_project_go_online_count'] = $projectModel->counts(['uptime'=>['between',[$start_time,$end_time]],'deleted_at'=>0]);//当月上线项目数量
160 $data[$v]['month_project_online_rate'] = 0; 160 $data[$v]['month_project_online_rate'] = 0;
161 if($data[$v]['month_create_project_count'] != 0){ 161 if($data[$v]['month_create_project_count'] != 0){
162 - $data[$v]['month_project_online_rate'] = $data[$v]['month_project_go_online_count'] / $data[$v]['month_create_project_count'];//比例 162 + $data[$v]['month_project_online_rate'] = round($data[$v]['month_project_go_online_count'] / $data[$v]['month_create_project_count'],2);//比例
163 } 163 }
164 -// $data[$v]['count'] = $projectModel->count(['deleted_at'=>0]);//所有项目总数  
165 -// $data[$v]['go_online_count'] = $projectModel->count(['uptime'=>['!=',null],'deleted_at'=>0]);//上线项目总数  
166 -// $data[$v]['promotion_web_count'] = $projectModel->count(['type'=>3,'deleted_at'=>0]);//推广项目总数  
167 -// $data[$v]['create_web_count'] = $projectModel->count(['type'=>2,'deleted_at'=>0]);//建站项目总数  
168 -// $data[$v]['no_go_oline_count'] = $projectModel->count(['uptime'=>null,'deleted_at'=>0]);//未上线项目数量  
169 -// $data[$v]['delete_project_count'] = $projectModel->count(['deleted_at'=>1]);//未上线项目数量  
170 -// $min_info = $projectModel->select('diff')->selectRaw('(uptime - created_at) as diff')->where('uptime','!=',null)->orderByRaw('diff ASC')->first();  
171 -// $data[$v]['min_project_count'] = $min_info['diff'];  
172 -// $max_info = $projectModel->select('diff')->selectRaw('(uptime - created_at) as diff')->where('uptime','!=',null)->orderByRaw('diff Desc')->first();  
173 -// $data[$v]['max_project_count'] = $max_info['diff'];  
174 -// $data[$v]['average'] = ceil(($max_info['diff'] + $min_info['diff']) / 2); 164 + $data[$v]['count'] = $projectModel->counts(['deleted_at'=>0,'created_at'=>['<=',$end_time]]);//所有项目总数
  165 + $data[$v]['go_online_count'] = $projectModel->counts(['uptime'=>['!=',null],'deleted_status'=>0,'created_at'=>['<=',$end_time]]);//上线项目总数
  166 + $data[$v]['promotion_web_count'] = $projectModel->counts(['type'=>3,'deleted_status'=>0,'created_at'=>['<=',$end_time]]);//推广项目总数
  167 + $data[$v]['create_web_count'] = $projectModel->counts(['type'=>2,'deleted_status'=>0,'created_at'=>['<=',$end_time]]);//建站项目总数
  168 + $data[$v]['no_go_oline_count'] = $projectModel->counts(['uptime'=>null,'deleted_status'=>0,'created_at'=>['<=',$end_time]]);//未上线项目数量
  169 + $data[$v]['delete_project_count'] = $projectModel->counts(['deleted_status'=>1,'created_at'=>['<=',$end_time]]);//删除
  170 + $min_info = $projectModel->select('diff')->selectRaw('(uptime - created_at) as diff')->where('uptime','!=',null)->where('created_at','<=',$end_time)->orderByRaw('diff ASC')->first();
  171 + $data[$v]['min_project_count'] = $min_info['diff'];
  172 + $max_info = $projectModel->select('diff')->selectRaw('(uptime - created_at) as diff')->where('uptime','!=',null)->where('created_at','<=',$end_time)->orderByRaw('diff Desc')->first();
  173 + $data[$v]['max_project_count'] = $max_info['diff'];
  174 + $data[$v]['average'] = ceil(($max_info['diff'] + $min_info['diff']) / 2);
175 } 175 }
176 return $data; 176 return $data;
177 } 177 }