|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Console\Commands; |
|
4
|
|
|
|
|
5
|
|
|
use App\Http\Controllers\BulkPromotion; |
|
6
|
|
|
use Webpatser\Uuid\Uuid; |
|
7
|
|
|
use App\Institution_grade; |
|
|
|
|
|
|
8
|
|
|
use App\Models\Institution; |
|
9
|
|
|
use App\Models\Academic_period; |
|
10
|
|
|
use App\Models\Education_grade; |
|
11
|
|
|
use Illuminate\Console\Command; |
|
12
|
|
|
use App\Models\Institution_class; |
|
13
|
|
|
use Illuminate\Support\Facades\DB; |
|
14
|
|
|
use App\Models\Institution_student; |
|
15
|
|
|
use App\Models\Institution_subject; |
|
16
|
|
|
use Illuminate\Support\Facades\Log; |
|
17
|
|
|
use App\Models\Institution_class_student; |
|
18
|
|
|
use App\Models\Institution_class_subject; |
|
19
|
|
|
use App\Models\Institution_subject_student; |
|
20
|
|
|
use App\Models\Institution_student_admission; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* Class PromoteStudents |
|
24
|
|
|
* @package App\Console\Commands |
|
25
|
|
|
*/ |
|
26
|
|
|
class PromoteStudents extends Command |
|
27
|
|
|
{ |
|
28
|
|
|
/** |
|
29
|
|
|
* The name and signature of the console command. |
|
30
|
|
|
* |
|
31
|
|
|
* @var string |
|
32
|
|
|
*/ |
|
33
|
|
|
protected $signature = 'promote:students {institution} {year} {mode}'; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* The console command description. |
|
37
|
|
|
* |
|
38
|
|
|
* @var string |
|
39
|
|
|
*/ |
|
40
|
|
|
protected $description = 'Promote students'; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Create a new command instance. |
|
44
|
|
|
* |
|
45
|
|
|
* @return void |
|
46
|
|
|
*/ |
|
47
|
|
|
public function __construct() |
|
48
|
|
|
{ |
|
49
|
|
|
parent::__construct(); |
|
50
|
|
|
$this->instituion_grade = new \App\Models\Institution_grade(); |
|
|
|
|
|
|
51
|
|
|
$this->academic_period = new Academic_period(); |
|
|
|
|
|
|
52
|
|
|
} |
|
53
|
|
|
|
|
54
|
|
|
|
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Execute the console command. |
|
58
|
|
|
* |
|
59
|
|
|
* @return mixed |
|
60
|
|
|
*/ |
|
61
|
|
|
public function handle() |
|
62
|
|
|
{ |
|
63
|
|
|
$output = new \Symfony\Component\Console\Output\ConsoleOutput(); |
|
64
|
|
|
$year = $this->argument('year'); |
|
65
|
|
|
$institution = $this->argument('institution'); |
|
66
|
|
|
$academicPeriod = $this->academic_period->getAcademicPeriod($year); |
|
67
|
|
|
$previousAcademicPeriodYear = $academicPeriod->order; |
|
|
|
|
|
|
68
|
|
|
$previousAcademicPeriod = Academic_period::where('order',$previousAcademicPeriodYear+1)->first(); |
|
69
|
|
|
$mode = $this->argument('mode'); |
|
70
|
|
|
$institutionGrade = $this->instituion_grade->getInstitutionGradeToPromoted($previousAcademicPeriod->code,$institution,$mode); |
|
|
|
|
|
|
71
|
|
|
$output->writeln('Start promoting:'.$institution); |
|
|
|
|
|
|
72
|
|
|
$params = [ |
|
73
|
|
|
'academicPeriod' => $academicPeriod, |
|
74
|
|
|
'previousAcademicPeriod' => $previousAcademicPeriod |
|
75
|
|
|
]; |
|
76
|
|
|
(new BulkPromotion())->callback($institutionGrade,$params); |
|
77
|
|
|
$output->writeln('Finished promoting:'.$institution); |
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths