29 lines
574 B
PHP
29 lines
574 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use CodeIgniter\Model;
|
|
|
|
class PasienModel extends Model
|
|
{
|
|
protected $table = 'pasien';
|
|
protected $primaryKey = 'id';
|
|
|
|
protected $allowedFields = [
|
|
'rm',
|
|
'nama',
|
|
'tgl_lahir',
|
|
'gender',
|
|
'alamat'
|
|
];
|
|
|
|
protected $useTimestamps = true;
|
|
protected $createdField = 'created_at';
|
|
protected $updatedField = 'updated_at';
|
|
|
|
// 🔵 cari pasien berdasarkan RM
|
|
public function findByRM($rm)
|
|
{
|
|
return $this->where('rm', $rm)->first();
|
|
}
|
|
} |