我在我的Laravel项目中实现了以下查询,如果我在控制台中复制粘贴,则查询可以工作,但DB对象在子查询group by zeit_von上设置为group by zeit_von is null ->select(
DB::raw('count(s.employee) asanzahl_employee
我正在尝试从以下原始查询创建一个laravel查询构建器: SELECT establishments.*, SUM(invoice_rows.total_price) as total_price_suminvoice_rows.invoice_article_group_id = 11 ORDER BY total_price_sum DESC 我尝试了不同的方法,例如: with、whereHas和withCount,但我似乎无法为原始查询创