Add Appointment Type

This commit is contained in:
R
2023-02-15 10:46:37 +07:00
parent 5f05f191c6
commit 5a7695b404
3 changed files with 21 additions and 3 deletions

View File

@@ -31,6 +31,12 @@ class Appointment extends Model
5 => 'Voucher',
];
public $nIDJenisBookingNames = [
1 => 'Rawat Jalan',
2 => 'Telekonsultasi',
3 => 'Chat Sekarang'
];
protected $connection = 'oldlms';
protected $table = 'tx_appointment';
@@ -53,7 +59,8 @@ class Appointment extends Model
protected $appends = [
'status_name',
'payment_method'
'payment_method',
'type'
];
protected function statusName(): Attribute
@@ -74,6 +81,15 @@ class Appointment extends Model
);
}
protected function type(): Attribute
{
return Attribute::make(
get: function($value) {
return $this->nIDJenisBookingNames[$this->nIDJenisBooking] ?? '-';
}
);
}
public function appointmentDetail()
{