using laravel fetch all columns from profile table and on left join fetch profile image from another table and using select count of amount from payment table while payment have multiple columns of amount while these three tables have common column as user id how to make this function in laravel controller
$clientsLevelOne = DB::table('clients')
->select(DB::raw("SUM((payment_amount).topup_amount) as count"))
->leftjoin('clients_payment_type','clients_payment_type.user_id', '=', 'clients.id')
->leftjoin('clients_topup', 'clients_topup.user_id', '=', 'clients.id')
->where('clients.under_reference','=',$client->reference_id)
->whereIn('client_id', $client_id_list)
->groupBy('client_id')
->get();
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2s1RpVE
via IFTTT
Aucun commentaire:
Enregistrer un commentaire