diff --git a/application/models/Admins_model.php b/application/models/Admins_model.php index 4ddb4d24..f1357330 100644 --- a/application/models/Admins_model.php +++ b/application/models/Admins_model.php @@ -178,7 +178,13 @@ class Admins_model extends EA_Model { $this->db->where('id_users !=', $admin_id); } - return $this->db->get_where('user_settings', ['username' => $username, 'delete_datetime' => NULL])->num_rows() === 0; + return $this + ->db + ->from('users') + ->join('user_settings', 'user_settings.id_users = users.id', 'inner') + ->where(['username' => $username, 'delete_datetime' => NULL]) + ->get() + ->num_rows() === 0; } /** diff --git a/application/models/Providers_model.php b/application/models/Providers_model.php index 6bcf1862..c10e3d61 100755 --- a/application/models/Providers_model.php +++ b/application/models/Providers_model.php @@ -193,7 +193,13 @@ class Providers_model extends EA_Model { $this->db->where('id_users !=', $provider_id); } - return $this->db->get_where('user_settings', ['username' => $username, 'delete_datetime' => NULL])->num_rows() === 0; + return $this + ->db + ->from('users') + ->join('user_settings', 'user_settings.id_users = users.id', 'inner') + ->where(['username' => $username, 'delete_datetime' => NULL]) + ->get() + ->num_rows() === 0; } /** diff --git a/application/models/Secretaries_model.php b/application/models/Secretaries_model.php index d5eb8a8e..179f268a 100644 --- a/application/models/Secretaries_model.php +++ b/application/models/Secretaries_model.php @@ -191,7 +191,13 @@ class Secretaries_model extends EA_Model { $this->db->where('id_users !=', $secretary_id); } - return $this->db->get_where('user_settings', ['username' => $username, 'delete_datetime' => NULL])->num_rows() === 0; + return $this + ->db + ->from('users') + ->join('user_settings', 'user_settings.id_users = users.id', 'inner') + ->where(['username' => $username, 'delete_datetime' => NULL]) + ->get() + ->num_rows() === 0; } /**