@@ -80,41 +80,41 @@ |
||
| 80 | 80 | $this->count += 1; |
| 81 | 81 | $this->student = $approvedstudent ; |
| 82 | 82 | try{ |
| 83 | - Institution_student::insert([ |
|
| 84 | - 'student_status_id' => 1, |
|
| 85 | - 'student_id' => $approvedstudent['student_id'], |
|
| 86 | - 'education_grade_id' => $approvedstudent['education_grade_id'], |
|
| 87 | - 'academic_period_id' => $approvedstudent['academic_period_id'], |
|
| 88 | - 'start_date' => $approvedstudent['start_date'], |
|
| 89 | - 'start_year' => \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $approvedstudent['start_date'])->year , // $approvedstudent['start_date']->format('Y'), |
|
| 90 | - 'end_date' => $approvedstudent['end_date'], |
|
| 91 | - 'end_year' => \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $approvedstudent['end_date'])->year , //$approvedstudent['end_date']->format('Y'), |
|
| 92 | - 'institution_id' => $approvedstudent['institution_id'], |
|
| 93 | - 'admission_id' => $approvedstudent['admission_id'], |
|
| 94 | - 'created_user_id' => $approvedstudent['created_user_id'], |
|
| 95 | - ]); |
|
| 83 | + Institution_student::insert([ |
|
| 84 | + 'student_status_id' => 1, |
|
| 85 | + 'student_id' => $approvedstudent['student_id'], |
|
| 86 | + 'education_grade_id' => $approvedstudent['education_grade_id'], |
|
| 87 | + 'academic_period_id' => $approvedstudent['academic_period_id'], |
|
| 88 | + 'start_date' => $approvedstudent['start_date'], |
|
| 89 | + 'start_year' => \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $approvedstudent['start_date'])->year , // $approvedstudent['start_date']->format('Y'), |
|
| 90 | + 'end_date' => $approvedstudent['end_date'], |
|
| 91 | + 'end_year' => \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $approvedstudent['end_date'])->year , //$approvedstudent['end_date']->format('Y'), |
|
| 92 | + 'institution_id' => $approvedstudent['institution_id'], |
|
| 93 | + 'admission_id' => $approvedstudent['admission_id'], |
|
| 94 | + 'created_user_id' => $approvedstudent['created_user_id'], |
|
| 95 | + ]); |
|
| 96 | 96 | |
| 97 | - if(!is_null($approvedstudent['institution_class_id'])){ |
|
| 98 | - Institution_class_student::insert([ |
|
| 99 | - 'student_id' => $approvedstudent['student_id'], |
|
| 100 | - 'institution_class_id' => $approvedstudent['institution_class_id'], |
|
| 101 | - 'education_grade_id' => $approvedstudent['education_grade_id'], |
|
| 102 | - 'academic_period_id' => $approvedstudent['academic_period_id'], |
|
| 103 | - 'institution_id' =>$approvedstudent['institution_id'], |
|
| 104 | - 'student_status_id' => 1, |
|
| 105 | - 'created_user_id' => $approvedstudent['created_user_id'], |
|
| 106 | - ]); |
|
| 107 | - } |
|
| 97 | + if(!is_null($approvedstudent['institution_class_id'])){ |
|
| 98 | + Institution_class_student::insert([ |
|
| 99 | + 'student_id' => $approvedstudent['student_id'], |
|
| 100 | + 'institution_class_id' => $approvedstudent['institution_class_id'], |
|
| 101 | + 'education_grade_id' => $approvedstudent['education_grade_id'], |
|
| 102 | + 'academic_period_id' => $approvedstudent['academic_period_id'], |
|
| 103 | + 'institution_id' =>$approvedstudent['institution_id'], |
|
| 104 | + 'student_status_id' => 1, |
|
| 105 | + 'created_user_id' => $approvedstudent['created_user_id'], |
|
| 106 | + ]); |
|
| 107 | + } |
|
| 108 | 108 | $output->writeln(' |
| 109 | 109 | #################################################### |
| 110 | 110 | Total number of students updated : '.$this->count.' |
| 111 | 111 | # # |
| 112 | 112 | ####################################################' ); |
| 113 | 113 | // $output->writeln(); |
| 114 | - }catch (\Exception $e){ |
|
| 114 | + }catch (\Exception $e){ |
|
| 115 | 115 | // echo $e->getMessage(); |
| 116 | - $output->writeln( $e->getMessage()); |
|
| 117 | - } |
|
| 116 | + $output->writeln( $e->getMessage()); |
|
| 117 | + } |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | dd($approvedstudent); |
| 61 | 61 | $approvedstudent = array_chunk($approvedstudent, 50); |
| 62 | 62 | array_walk($approvedstudent, array($this, 'addStudents')); |
| 63 | - }catch (\Exception $e) { |
|
| 63 | + } catch (\Exception $e) { |
|
| 64 | 64 | Log::error($e); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | # # |
| 112 | 112 | ####################################################' ); |
| 113 | 113 | // $output->writeln(); |
| 114 | - }catch (\Exception $e){ |
|
| 114 | + } catch (\Exception $e){ |
|
| 115 | 115 | // echo $e->getMessage(); |
| 116 | 116 | $output->writeln( $e->getMessage()); |
| 117 | 117 | } |