Fixes for client portal constraint
This commit is contained in:
parent
f9fae690a0
commit
499d9f6b86
1 changed files with 3 additions and 1 deletions
|
|
@ -32,7 +32,6 @@ class CheckClientExistence
|
|||
->where('email', auth('contact')->user()->email)
|
||||
->whereNotNull('email')
|
||||
->where('email', '<>', '')
|
||||
->where('account_id', auth('contact')->user()->client->company->account->id)
|
||||
->whereNull('deleted_at')
|
||||
->distinct('company_id')
|
||||
->distinct('email')
|
||||
|
|
@ -40,6 +39,9 @@ class CheckClientExistence
|
|||
->whereHas('client', function ($query) {
|
||||
return $query->whereNull('deleted_at');
|
||||
})
|
||||
->whereHas('client.company', function ($query){
|
||||
return $query->where('account_id', auth('contact')->user()->client->company->account->id);
|
||||
})
|
||||
->get();
|
||||
|
||||
if (count($multiple_contacts) == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue