here is the SQL Query
SELECT sum(statement.amount)
FROM statement, lender
WHERE statement.type = 01
AND lender.id = statement.lender_id
AND statement.stat = 888
AND lender.user_id = users.id
And this is my code in controller
$count_totaldeposit = DB::table('statement')->join('lender','lender.id', '=', 'statement.lender_id')
->where('lender.user_id',$userId)
->where('type',01)
->where('statement.stat',888)->sum('statement.amount');
I dont know where is the issue, anybody can help me with the code?
Thanks in advance.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire