日期范围内我有一个数据库表dateprices
搜索与laravel
id|tour_id|start|end|price
我想游出发的所有价格和日期之间结束,即2017-06-20
和2017-07-11
我有写下面的查询,但它是返回一个空的集合:
$dates = DatePrice::where('tour_id','=',$request->product_id)
->where('start', 'like', '%'.$request->start.'%')
->where('end', 'like', '%'.$request->end.'%')
->get();
是否有东西我的查询错误?
即使我将今天的日期作为开始日期并将明天的日期作为结束日期,该查询将给我表的所有行。 –