Ejemplo n.º 1
0
 public function getBatchDelayed()
 {
     $batchDelayed = [];
     $batches = [200000000, 200100000, 200200000, 200300000, 200400000, 200500000, 200600000, 200700000, 200800000, 200900000];
     foreach ($batches as $batch) {
         $allBatchDelayed = Studentdelayed::getBatchDelayedCount($batch);
         $allBatchStudents = Studentterm::getBatchStudentsCount($batch);
         $batchDelayed[$batch / 100000] = round($allBatchDelayed / $allBatchStudents * 100, 2);
     }
     return $batchDelayed;
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::table('correlations', function (Blueprint $table) {
         //
     });
     $entries = Correlation::where('unittype', 'campus')->get();
     foreach ($entries as $entry) {
         $batch = $entry->batch;
         $dropouts = Studentdropout::getBatchDropoutsCount($batch * 100000);
         $delayed = Studentdelayed::getBatchDelayedCount($batch * 100000);
         $students = Studentterm::getBatchStudentsCount($batch * 100000);
         if ($students > 0) {
             $entry->dropouts = ($dropouts + $delayed) / $students;
         } else {
             $entry->dropouts = 0;
         }
         $entry->save();
     }
 }