Browse Source

完成新增数据概览

master
崔茂正 11 months ago
parent
commit
d816463fb5
  1. 2
      app/Admin/Controllers/HomeController.php
  2. 5
      app/Admin/Metrics/Chart/ColumnCharts.php
  3. 5
      app/Admin/Metrics/Chart/FemaleColumnCharts.php
  4. 5
      app/Admin/Metrics/Chart/FullPaymentRateColumnCharts.php
  5. 5
      app/Admin/Metrics/Chart/MaleColumnCharts.php

2
app/Admin/Controllers/HomeController.php

@ -43,7 +43,7 @@ class HomeController extends Controller @@ -43,7 +43,7 @@ class HomeController extends Controller
$row->column(3, new Examples\FemaleRegistering()); //女生报到率
$row->column(6, Card::make('各学院报到率',ColumnCharts::make()));
// $row->column(6, Card::make('各学院全额缴费率',FullPaymentRateColumnCharts::make()));
$row->column(6, Card::make('各学院全额缴费率',FullPaymentRateColumnCharts::make()));
$row->column(6, Card::make('各学院男生报到率',MaleColumnCharts::make()));
$row->column(6, Card::make('各学院女生报到率',FemaleColumnCharts::make()));

5
app/Admin/Metrics/Chart/ColumnCharts.php

@ -78,7 +78,12 @@ class ColumnCharts extends Chart @@ -78,7 +78,12 @@ class ColumnCharts extends Chart
$completedOfflineStep = CompletedOfflineStep::query()->whereIn("unique_number", $userList)->where("annual_session", $config->data)->where("step_id",">=",$stepCount)->count();
//报到率
if($completedOfflineStep == 0 || count($importStudents) == 0){
$registering = 0;
}else{
$registering = ($completedOfflineStep / count($importStudents) * 100) ;
}
$list[$key]["registering"] = $registering;
}
}

5
app/Admin/Metrics/Chart/FemaleColumnCharts.php

@ -86,7 +86,12 @@ class FemaleColumnCharts extends Chart @@ -86,7 +86,12 @@ class FemaleColumnCharts extends Chart
$studentsNum = count($importStudents);
//报到率
if($completedOfflineStep == 0 || $studentsNum == 0){
$registering = 0;
}else{
$registering = (($completedOfflineStep / $studentsNum) * 100) ;
}
$list[$key]["registering"] = $registering;
}
}

5
app/Admin/Metrics/Chart/FullPaymentRateColumnCharts.php

@ -92,7 +92,12 @@ class FullPaymentRateColumnCharts extends Chart @@ -92,7 +92,12 @@ class FullPaymentRateColumnCharts extends Chart
$studentsNum = count($paymentList);
//报到率
if($studentsNum == 0 || $completedOfflineStep == 0){
$registering = 0;
}else{
$registering = (($studentsNum / $completedOfflineStep ) * 100) ;
}
$list[$key]["registering"] = $registering;
}
}

5
app/Admin/Metrics/Chart/MaleColumnCharts.php

@ -86,7 +86,12 @@ class MaleColumnCharts extends Chart @@ -86,7 +86,12 @@ class MaleColumnCharts extends Chart
$studentsNum = count($importStudents);
//报到率
if($completedOfflineStep == 0 || $studentsNum == 0){
$registering = 0;
}else{
$registering = (($completedOfflineStep / $studentsNum) * 100) ;
}
$list[$key]["registering"] = $registering;
}
}

Loading…
Cancel
Save