我在laravel orm中的查询后有了变化。但这不是工作。
在sql中
select * from `promotions` join items on items.id = promotions.item_id where promotions.start >= "2014-12-30" and promotions.end <="2015-01-30"在orm中
$result = Promotion::whereNull('promotions.deleted_at')
->select('promotions.*','items.name as i_name')
->join('items', 'items.id', '=', 'promotions.item_id')
->where('start', '>=', $start || 'end', '<=', $end)
->get();发布于 2014-12-31 11:57:05
链接两个where调用:
->where('start', '>=', $start)
->where('end', '<=', $end)或者使用whereBetween。
https://stackoverflow.com/questions/27715790
复制相似问题