John Davidson

php - I want to sum bill_amount column where order_id is not same . Actually I want to get due amount

0 comments
Message:


Here is the eloquent query of Laravel I gave that in below.


Actually, I ignore all bill_amount. I want to take only one bill_amount per order_id


  @php
$total=App\Billing::where('order_id','!=','order_id')->where('buyer_id',Auth::use

r()->buyer_id)->sum('bill_amount');
$pay=App\Billing::where('buyer_id',Auth::user()->buyer_id)->sum('payment_amount');
$due=$total-$pay;
@endphp

Here is the database table red mark I want to get this value




My Answer:
>sum('bill_amount');

Rate this post

5 of 5 based on 9668 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us