📜  在 laravel 中选择总和 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:02.980000             🧑  作者: Mango

代码示例1
Sometime for such queries you need to disable the strict check
 So inside config/database.php and inside mysql, 
 Set 'strict' => false,

->select('user_id', DB::raw('SUM(points) as total_points'))