2016-09-20 102 views
3

我想在laravel 5.2如何寫> =在laravel雄辯數據庫查詢5.2

Movies_showtimes::with('showdata','movie','cinema')->where(['cinema_id'=>$id,'show_date'=>Carbon::today()])->get(); 

這個查詢火雄辯查詢獲取僅今天日期的所有電影場次。我想爲=>今天的電影放映時間獲取,但是我無法在上面的查詢中的where子句中使用> =符號。

幫助表示讚賞。我試圖做這樣的,但它並沒有爲我工作

Movies_showtimes::with('showdata','movie','cinema')->where(['cinema_id'=>$id,'show_date','>=',Carbon::today()])->get(); 

回答

4

嘗試此查詢

Movies_showtimes::with('showdata','movie','cinema')->where(
    [['cinema_id','=',$id],['show_date','>=',Carbon::today()]] 
    )->get(); 
+0

Movies_showtimes ::與( 'showdata', '電影', '電影') - >在哪裏( [ 'cinema_id', '=',$ ID],[ 'SHOW_DATE', '> =',碳::今日()]]) - >獲得();我在使用WhereColumn – dollar

+0

時出現錯誤,上面爲我工作 – dollar