Search
 
SCRIPT & CODE EXAMPLE
 

PHP

sum multiple fields separately in laravel

$customer = FinanceSale::select(
  DB::raw('SUM(sub_total) as total_sales'),
  DB::raw('SUM(discount) as d'),
)
->where('customer_id', $id)
->groupBy('customer_id')
->first();
Comment

PREVIOUS NEXT
Code Example
Php :: php script to calculate next 50 days from current date 
Php :: php retour à la ligne 
Php :: how to debug php 
Php :: Laravel Add regx on password 
Php :: wordpress get current category slug 
Php :: php reset mysql array 
Php :: phph get server protocol 
Php :: the token has been blacklisted laravel jwt 
Php :: artisan call migrate result 
Php :: switch php version 
Php :: php explode by tab 
Php :: redirect wordpress 
Php :: php url parse 
Php :: remove html from string php 
Php :: php shorthand if isset 
Php :: Uncaught Error: Call to undefined function "themeblvd_add_builder_element()" 
Php :: create guid in php 
Php :: laravel end date greater than start date validation 
Php :: Classified script with mobile app laravel 
Php :: one item limit on cart in woocommerce 
Php :: how can get url from $request in laravel 
Php :: Google Dorks Using special search string to find vulnerable websites: 
Php :: laravel with trashed specific 
Php :: laravel custom error page 
Php :: php show number 4 digit 
Php :: forelse laravel 
Php :: laravel store multiple files 
Php :: drupal 9 enable PHP errors 
Php :: PHP File Open/Read/Close 
Php :: php return json response with status code 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =