type query is now laravel format. total is wrong