Update AccountRepository.php

This commit is contained in:
ridgarou 2016-02-09 12:37:23 +01:00
parent 55f26c9ea5
commit 60530d3cbc

View File

@ -75,21 +75,21 @@ class AccountRepository
->where('clients.deleted_at', '=', null) ->where('clients.deleted_at', '=', null)
->where('clients.account_id', '=', \Auth::user()->account_id) ->where('clients.account_id', '=', \Auth::user()->account_id)
->whereRaw("clients.name <> ''") ->whereRaw("clients.name <> ''")
->select(\DB::raw("'Clients' as type, clients.public_id, clients.name, '' as token")); ->select(\DB::raw("'" . trans('texts.clients') . "' as type, clients.public_id, clients.name, '' as token"));
$contacts = \DB::table('clients') $contacts = \DB::table('clients')
->join('contacts', 'contacts.client_id', '=', 'clients.id') ->join('contacts', 'contacts.client_id', '=', 'clients.id')
->where('clients.deleted_at', '=', null) ->where('clients.deleted_at', '=', null)
->where('clients.account_id', '=', \Auth::user()->account_id) ->where('clients.account_id', '=', \Auth::user()->account_id)
->whereRaw("CONCAT(contacts.first_name, contacts.last_name, contacts.email) <> ''") ->whereRaw("CONCAT(contacts.first_name, contacts.last_name, contacts.email) <> ''")
->select(\DB::raw("'Contacts' as type, clients.public_id, CONCAT(contacts.first_name, ' ', contacts.last_name, ' ', contacts.email) as name, '' as token")); ->select(\DB::raw("'" . trans('texts.contacts') . "' as type, clients.public_id, CONCAT(contacts.first_name, ' ', contacts.last_name, ' ', contacts.email) as name, '' as token"));
$invoices = \DB::table('clients') $invoices = \DB::table('clients')
->join('invoices', 'invoices.client_id', '=', 'clients.id') ->join('invoices', 'invoices.client_id', '=', 'clients.id')
->where('clients.account_id', '=', \Auth::user()->account_id) ->where('clients.account_id', '=', \Auth::user()->account_id)
->where('clients.deleted_at', '=', null) ->where('clients.deleted_at', '=', null)
->where('invoices.deleted_at', '=', null) ->where('invoices.deleted_at', '=', null)
->select(\DB::raw("'Invoices' as type, invoices.public_id, CONCAT(invoices.invoice_number, ': ', clients.name) as name, invoices.invoice_number as token")); ->select(\DB::raw("'" . trans('texts.invoices') . "' as type, invoices.public_id, CONCAT(invoices.invoice_number, ': ', clients.name) as name, invoices.invoice_number as token"));
$data = []; $data = [];