I am trying to get the total of the column Price
with condition BillPaid
column value should be 0
.
My code block is
public function countDue()
{
$getTotalDue = DB::table('ordered_books')
->where('BillPaid', 0)
->sum('Price')
->get();
return response()->json($getTotalDue);
return compact('getTotalDue');
}
but I am getting error as :
Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to a member function get() on float
My table structure is:
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire