db = \Config\Database::connect(); $this->request = \Config\Services::request(); } protected $table = 'demam_hasil'; protected $primaryKey = 'id'; protected $returnType = 'object'; protected $allowedFields = ['id','Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember']; public function getDarah() { return $this->orderBy('id', 'DESC')->get(); } public function insert_darah($data) { return $this->db->table($this->table)->insert($data); } public function getById($id) { return $this->where(['id' => $id])->get(); } }