2015-02-24 73 views
0

我正在使用laravel。在我的控制器中,我使用了一個查詢(下面給出)。是否有任何修改後的查詢?或者它okk?這個查詢是否有任何修改查詢:

$sub = Studentacademicinfo::where('class','=',$cat)->where('section','=',$section)->get(); 

回答

1

你可以這樣做,如果你想整理代碼:

$sub = Studentacademicinfo::whereClass($cat)->whereSection($section)->get(); 

但由此產生的SQL將是相同的