mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-10 10:02:33 +03:00
Check only in the non-deleted customers, when validating the email address (#1246)
This commit is contained in:
parent
98bf660aa2
commit
6b738a1ea5
1 changed files with 4 additions and 1 deletions
|
@ -133,6 +133,7 @@ class Customers_model extends EA_Model {
|
||||||
->select()
|
->select()
|
||||||
->from('users')
|
->from('users')
|
||||||
->join('roles', 'roles.id = users.id_roles', 'inner')
|
->join('roles', 'roles.id = users.id_roles', 'inner')
|
||||||
|
->where('users.delete_datetime', NULL)
|
||||||
->where('roles.slug', DB_SLUG_CUSTOMER)
|
->where('roles.slug', DB_SLUG_CUSTOMER)
|
||||||
->where('users.email', $customer['email'])
|
->where('users.email', $customer['email'])
|
||||||
->where('users.id !=', $customer_id)
|
->where('users.id !=', $customer_id)
|
||||||
|
@ -181,7 +182,7 @@ class Customers_model extends EA_Model {
|
||||||
protected function update(array $customer): int
|
protected function update(array $customer): int
|
||||||
{
|
{
|
||||||
$customer['update_datetime'] = date('Y-m-d H:i:s');
|
$customer['update_datetime'] = date('Y-m-d H:i:s');
|
||||||
|
|
||||||
if ( ! $this->db->update('users', $customer, ['id' => $customer['id']]))
|
if ( ! $this->db->update('users', $customer, ['id' => $customer['id']]))
|
||||||
{
|
{
|
||||||
throw new RuntimeException('Could not update customer.');
|
throw new RuntimeException('Could not update customer.');
|
||||||
|
@ -359,6 +360,7 @@ class Customers_model extends EA_Model {
|
||||||
->from('users')
|
->from('users')
|
||||||
->join('roles', 'roles.id = users.id_roles', 'inner')
|
->join('roles', 'roles.id = users.id_roles', 'inner')
|
||||||
->where('users.email', $customer['email'])
|
->where('users.email', $customer['email'])
|
||||||
|
->where('users.delete_datetime', NULL)
|
||||||
->where('roles.slug', DB_SLUG_CUSTOMER)
|
->where('roles.slug', DB_SLUG_CUSTOMER)
|
||||||
->get()
|
->get()
|
||||||
->num_rows();
|
->num_rows();
|
||||||
|
@ -388,6 +390,7 @@ class Customers_model extends EA_Model {
|
||||||
->from('users')
|
->from('users')
|
||||||
->join('roles', 'roles.id = users.id_roles', 'inner')
|
->join('roles', 'roles.id = users.id_roles', 'inner')
|
||||||
->where('users.email', $customer['email'])
|
->where('users.email', $customer['email'])
|
||||||
|
->where('users.delete_datetime', NULL)
|
||||||
->where('roles.slug', DB_SLUG_CUSTOMER)
|
->where('roles.slug', DB_SLUG_CUSTOMER)
|
||||||
->get()
|
->get()
|
||||||
->row_array();
|
->row_array();
|
||||||
|
|
Loading…
Reference in a new issue