Click here to Skip to main content
15,941,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how do I distinguish the status of a transaction, if in my code now it only shows the total transaction, but not the status of each transaction, for example there are 10 transactions, now in 10 there are successful transactions 4 failed 4 cancel 4

What I have tried:

DB::table('covis_transactions as a')
->leftJoin('covis_customers as b', 'a.covis_customer_id','')
->leftJoin('companies as c', 'b.company_id', '')
->leftJoin('projects as d', 'b.project_id', '')
->leftJoin('branchs as e', 'b.branch_id', '')
->leftJoin('regions as f', 'b.region_id', '')
->whereBetween('a.visited_at', [$from, $to])
->where('e.is_active', 1)
'a.status as status',
' as customer_name',
' as branch_name',
' as company_name',
' as project_name',
' as region_name',
'e.code as branch_code',
' as branch_id',
DB::raw('COUNT( as total_transaksi'),
Updated 29-May-22 21:36pm
jijomp12 28-Jul-22 3:14am    
Your question is not clear

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900