支持直接从评论中一键生成节目

This commit is contained in:
2022-08-07 13:44:40 +08:00
parent 60a2ef15dc
commit b1124432c7
2 changed files with 19 additions and 1 deletions

View File

@ -10,9 +10,16 @@ class VideoQueryController extends BaseController
{
public function info(Request $request, Videos $video)
{
$pivots = $video->program_pivots;
if (sizeof($pivots) === 0) {
$comment = $video->comments()->where("is_top", "=", 1)->first();
} else {
$comment = null;
}
return view("video.index", [
"video" => $video,
"video_pivots" => $video->program_pivots
"video_pivots" => $pivots,
"comment" => $comment,
]);
}
}