这是我的laravel数据库查询
DB::table ( 'zee_hours' )
->select (
[
'zee_hours.hours',
DB::raw ( 'COALESCE(count(zee_shipment_events.amazon_order_id),0)' ),
] )
->leftJoin ( 'zee_shipment_events', 'zee_hours.hours', '=', DB::raw ( 'HOUR(zee_shipment_events.pdate)' ) )
->join ( 'zee_shipment_items', 'zee_shipment_items.shipment_id', '=', 'zee_shipment_events.id' )
->join ( 'zee_promotions', 'zee_promotions.shipment_item_id', '=', 'zee_shipment_items.id' )
->groupBy ( 'zee_hours.hours' )
->get ();
问题 通过这种方式,我只能获得订单下达的那些时间。
我想要的是,我甚至需要那些没有下订单的时间(显示为0)
努力了,但仍然没有办法