My table definition is as below
**PURCHASE_PYAMENTS**
SELLER MASTER_PAYMENT BILL COUNT_VB PAYMENT_STATUS REMAIN_PARTIAL_AMOUNT
abc 15000 0 0 1 0
xyz 14000 1 1 1 14000
abc 15000 0 0 0 5000
I need sum
of master_payment
column for specific seller
under two condition:
payment_status = 1
andcount_vb = 0
payment_status = 0
andremain_partial_amount > 0
If any of above condition goes true then master_payment
should add in sum
so, how can I achieve it using single query?.
I try it by my self but get a result for only one condition my query is as below:
$total_count_vb = DB::table('purchase_payments')
->where('seller',$seller_list)
->where('count_vb',0)
->where('payment_status',1)
->SUM('master_payment');