db->insert($table, $data); }else{ $insert = $this->db->insert_batch($table, $data); } return $insert; } public function update($table, $data, $pk, $id = null, $batch = false) { if($batch === false){ $insert = $this->db->update($table, $data, array($pk => $id)); }else{ $insert = $this->db->update_batch($table, $data, $pk); } return $insert; } public function delete($table, $data, $pk) { $this->db->where_in($pk, $data); return $this->db->delete($table); } public function getDataOs($id = null){ if ($id === null) { $this->db->select('*'); $this->db->from('os'); }else{ $this->db->select('*'); $this->db->from('os'); $this->db->where(['ID_OS' => $id]); } return $this->db->get()->result_array(); } public function view() { return $this->db->get('sn')->result(); } public function save_batch($data) { return $this->db->insert_batch('sn', $data); } } ?>