diff --git a/src/app/Services/ParticipantImportService.php b/src/app/Services/ParticipantImportService.php index a15bea8..f249a62 100644 --- a/src/app/Services/ParticipantImportService.php +++ b/src/app/Services/ParticipantImportService.php @@ -109,6 +109,15 @@ class ParticipantImportService ] ); + // Kemaskini emel, telefon dan agensi jika peserta sedia ada dan CSV ada data + if (! $participant->wasRecentlyCreated) { + $updates = []; + if (! empty($data['email'])) $updates['email'] = $data['email']; + if (! empty($data['phone'])) $updates['phone'] = $data['phone']; + if (! empty($data['agency'])) $updates['agency'] = $data['agency']; + if ($updates) $participant->update($updates); + } + $pp = $program->programParticipants() ->where('participant_id', $participant->id) ->first();