$ this-> datatables-> select(“ purchases.id,purchases.date,purchases.reference_no,purchase.supplier,purchases.status,purchases.grand_total,purchases.paid,(purchases.grand_total-purchases.paid)作为余额,purchases.payment_status”) -> from('purchases')-> join('purchases as a','purchases.id = a.return_purchase_ref');