|
|
|
|
@ -15,7 +15,7 @@ class TrainingController extends CommonController
|
|
|
|
|
* description="获取视频列表",
|
|
|
|
|
* @OA\Parameter(name="keyword", in="query", @OA\Schema(type="string"), required=false, description="查询关键词"),
|
|
|
|
|
* @OA\Parameter(name="page", in="query", @OA\Schema(type="integer"), required=false, description="当前页码,默认为1"),
|
|
|
|
|
* @OA\Parameter(name="pageLength", in="query", @OA\Schema(type="integer"), required=false, description="每页数量,默认为3"),
|
|
|
|
|
* @OA\Parameter(name="page_size", in="query", @OA\Schema(type="integer"), required=false, description="每页数量,默认为3"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="获取视频列表"
|
|
|
|
|
@ -36,10 +36,10 @@ class TrainingController extends CommonController
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
$pageLength = request()->pageLength ? (int)request()->pageLength : 3;
|
|
|
|
|
$page_size = request()->page_size ? (int)request()->page_size : 3;
|
|
|
|
|
$data = $data->with(["type" => function ($query) {
|
|
|
|
|
$query->select("id", "name");
|
|
|
|
|
}])->select("id", "type_id", "title", "poster", "video", "published_at")->orderBy("published_at")->paginate($pageLength);
|
|
|
|
|
}])->select("id", "type_id", "title", "poster", "video", "published_at")->orderBy("published_at","desc")->paginate($page_size);
|
|
|
|
|
return response()->json($data->toArray());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|