1
My problem is this....
I have a route that receives the year and month to seek some information in the bank.
When the month doesn’t come I need to be made the sum of all the months of the requested year.
if($month == 0){
$dbRegister = DB::table('tb_data')->select(DB::raw("SUM(tb_data.total_points) as total_points"));
}else{
$dbRegister = DB::table('tb_data')->select('tb_data.total_points');
}
$dbRegister->select(DB::raw('tb_data.user)....
If I let select separate that way it doesn’t work. Someone would tell me?
Thank you :D
Possible duplicate of How to make several separate selects with the 4.2 Standard?
– novic