$list = DB::table('posts')
->groupBy('user_id')
->selectRaw('user_id,sum(views) as total_views')
->having('total_views' , '>=' , 10)
->get();
執行後報錯
Check in the config/database.php file in the mysql conection that the strict is false:
'strict' => false, // 更新爲false,就能執行了
If is true, put in false.