orderByDesc("selected_year", "desc")->orderByDesc("selected_month")->get(); $yearList = History::select("selected_year", \DB::raw("concat(selected_year, '年') as lable"))->distinct()->orderBy("selected_year", "desc")->pluck('lable', 'selected_year'); $result = []; $result["yearList"] = $yearList; foreach($data as $item){ $result["list"][$item->selected_year][] = [ "operateMonth " => $item->selected_year . "." . $item->selected_month, "title" => $item->getTranslation("title", $locate), "imgUrl" => $item->img_url_link ]; } return Response::ok($result); } }