deleted_at is null and parent_id is null order by created_at desc $res=DB::table('comments')
->select(DB::raw('comments.*, (select count(*) from `comments` b where b.parent_id
我有这个原始查询,我想在eloquent查询生成器中使用它,但似乎我不能在eloquent中使用date方法,并给了我这个错误,我在eloquent中新的。问题是什么: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'date(prizes.created_at), user_id' in 'group statement' (SQL: select user_id,COUNT(user_id), date(created_at) from `prizes` group by `date(priz