db->select('*'); $this->db->from('users'); $this->db->where('business_id', $business_id); $this->db->where('role', 'user'); // $this->db->where('role', 'user'); // $this->db->where('is_active', 1); $query = $this->db->get(); $query = $query->result(); return $query; } public function get_admin() { $this->db->select('*'); $this->db->from('users'); $this->db->where('role !=', 'sadmin'); $query = $this->db->get(); $query = $query->result(); return $query; } public function get_user_by_md5_id($id,$business_id) { $this->db->select('*'); $this->db->from('users'); $this->db->where('business_id', $business_id); $this->db->where('md5(id)', $id); $query = $this->db->get(); $query = $query->row(); return $query; } public function delete_user_by_md5_id($id,$business_id) { $this->db->where('md5(id)', $id); $this->db->where('business_id', $business_id); $this->db->where('role', 'user'); $this->db->set('is_active',0); $this->db->update('users'); return; } public function activate_inactive_users($id,$business_id) { $this->db->where('md5(id)', $id); $this->db->where('business_id', $business_id); $this->db->where('role', 'user'); $this->db->set('is_active',1); $this->db->update('users'); return; } public function business() { $this->db->select('*'); $this->db->from('business'); $query = $this->db->get(); $query = $query->result(); return $query; } }