日期範圍內我有一個數據庫表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();
是否有東西我的查詢錯誤?
即使我將今天的日期作爲開始日期並將明天的日期作爲結束日期,該查詢將給我表的所有行。 –