|
|
|
@ -16,14 +16,13 @@ class PublicController extends Controller
|
|
|
|
* @OA\Response(
|
|
|
|
* @OA\Response(
|
|
|
|
* response="200",
|
|
|
|
* response="200",
|
|
|
|
* description="获取医院列表",
|
|
|
|
* description="获取医院列表",
|
|
|
|
|
|
|
|
|
|
|
|
* )
|
|
|
|
* )
|
|
|
|
* )
|
|
|
|
* )
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
public function getProjects()
|
|
|
|
public function getProjects()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$projects = Project::select("id","name","address")->get();
|
|
|
|
$projects = Project::select("id", "name", "address")->get();
|
|
|
|
return response()->json($projects->toArray());
|
|
|
|
return response()->json($projects->toArray());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -56,10 +55,31 @@ class PublicController extends Controller
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$pageLength = request()->pageLength ? (int)request()->pageLength : 3;
|
|
|
|
$pageLength = request()->pageLength ? (int)request()->pageLength : 3;
|
|
|
|
$data = $data->with(["type"=>function($query) {
|
|
|
|
$data = $data->with(["type" => function ($query) {
|
|
|
|
$query->select("id","name");
|
|
|
|
$query->select("id", "name");
|
|
|
|
}])->select("id","type_id","poster","video","published_at")->orderBy("published_at")->paginate($pageLength);
|
|
|
|
}])->select("id", "type_id", "title","poster", "video", "published_at")->orderBy("published_at")->paginate($pageLength);
|
|
|
|
return response()->json($data->toArray());
|
|
|
|
return response()->json($data->toArray());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
|
|
|
* path="/customer/get-training-video/{id}",
|
|
|
|
|
|
|
|
* summary="V2-获取单条视频数据",
|
|
|
|
|
|
|
|
* description="获取单条视频数据",
|
|
|
|
|
|
|
|
* @OA\Parameter(name="id", in="path", @OA\Schema(type="integer"), required=true, description="视频内容ID"),
|
|
|
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
|
|
|
* response="200",
|
|
|
|
|
|
|
|
* description="获取单条视频数据"
|
|
|
|
|
|
|
|
* )
|
|
|
|
|
|
|
|
* )
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getTrainingVideo($id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$video = Training::with(["type" => function ($query) {
|
|
|
|
|
|
|
|
$query->select("id", "name");
|
|
|
|
|
|
|
|
}])->select("id", "type_id", "title","poster", "video", "published_at")->find($id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|