mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 19:14:35 -04:00
Fixes for client portal constraint
This commit is contained in:
parent
f9fae690a0
commit
499d9f6b86
@ -32,7 +32,6 @@ class CheckClientExistence
|
|||||||
->where('email', auth('contact')->user()->email)
|
->where('email', auth('contact')->user()->email)
|
||||||
->whereNotNull('email')
|
->whereNotNull('email')
|
||||||
->where('email', '<>', '')
|
->where('email', '<>', '')
|
||||||
->where('account_id', auth('contact')->user()->client->company->account->id)
|
|
||||||
->whereNull('deleted_at')
|
->whereNull('deleted_at')
|
||||||
->distinct('company_id')
|
->distinct('company_id')
|
||||||
->distinct('email')
|
->distinct('email')
|
||||||
@ -40,6 +39,9 @@ class CheckClientExistence
|
|||||||
->whereHas('client', function ($query) {
|
->whereHas('client', function ($query) {
|
||||||
return $query->whereNull('deleted_at');
|
return $query->whereNull('deleted_at');
|
||||||
})
|
})
|
||||||
|
->whereHas('client.company', function ($query){
|
||||||
|
return $query->where('account_id', auth('contact')->user()->client->company->account->id);
|
||||||
|
})
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
if (count($multiple_contacts) == 0) {
|
if (count($multiple_contacts) == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user