1
抱歉,新手问题。我想从表格特定的列中获取,按日期排序,只提取150行。我尝试了很多组合。但我不明白了应该如何工作的:Laravel Eloquent SELECT sortBy with limit 150 rows
public function get()
{
Excel::create('Bids-' . date("Y/m/d"), function($excel) {
$excel->sheet('Favourites', function($sheet) {
$comments = Comment::select('auction_name','bid','lot_date','company', 'model_name_en', 'body','grade_en', 'mileage_num', 'model_year_en', 'start_price_en')->sortBy("lot_date", 'desc')->take(150)->get();
$sheet->fromModel($comments);
});
})->download('xls');
}
请,可有人给我解释一下什么即时做错了,为什么sortBy
不用想工作吗?
请提供适当的格式和解释你的答案 – Ray
它的工作实际上,问题是,我需要在sortBy'的'代替使用'orderBy' –