1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 14:12:44 +01:00

Fix check data

This commit is contained in:
Hillel Coren 2017-06-05 11:44:51 +03:00
parent fe9ac56e4f
commit a621714951

View File

@ -356,7 +356,10 @@ class CheckData extends Command
private function checkInvitations()
{
$invoices = DB::table('invoices')
->leftJoin('invitations', 'invitations.invoice_id', '=', 'invoices.id')
->leftJoin('invitations', function ($join) {
$join->on('invitations.invoice_id', '=', 'invoices.id')
->whereNull('invitations.deleted_at');
})
->groupBy('invoices.id', 'invoices.user_id', 'invoices.account_id', 'invoices.client_id')
->havingRaw('count(invitations.id) = 0')
->get(['invoices.id', 'invoices.user_id', 'invoices.account_id', 'invoices.client_id']);