Skip to content

Commit

Permalink
default vaules for fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kiang committed Sep 4, 2022
1 parent 85fcbdc commit e5f33a7
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Console/Command/CandidateShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,25 @@ public function import_2022()
]);
if (!empty($candidate)) {
$this->Candidate->id = $candidate['Candidate']['id'];
$this->Candidate->save(['Candidate' => [
'election_id' => $line[4],
'name' => $line[2],
'party' => $line[3],
'stage' => 1,
]]);
} else {
$this->Candidate->create();
$this->Candidate->save(['Candidate' => [
'election_id' => $line[4],
'name' => $line[2],
'party' => $line[3],
'stage' => 1,
'education_level' => '',
'is_present' => 0,
'name_english' => '',
'birth_place' => '',
]]);
}
$this->Candidate->save(['Candidate' => [
'election_id' => $line[4],
'name' => $line[2],
'party' => $line[3],
'stage' => 1,
]]);
}
}

Expand Down

0 comments on commit e5f33a7

Please sign in to comment.