支持直接从评论中一键生成节目
This commit is contained in:
parent
60a2ef15dc
commit
b1124432c7
@ -10,9 +10,16 @@ class VideoQueryController extends BaseController
|
|||||||
{
|
{
|
||||||
public function info(Request $request, Videos $video)
|
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", [
|
return view("video.index", [
|
||||||
"video" => $video,
|
"video" => $video,
|
||||||
"video_pivots" => $video->program_pivots
|
"video_pivots" => $pivots,
|
||||||
|
"comment" => $comment,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,17 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@auth("web")
|
||||||
|
@if(sizeof($video_pivots) === 0 && $comment)
|
||||||
|
<form action="{{ url(route("program.construct.batch_create")) }}" method="post" enctype="multipart/form-data">
|
||||||
|
<input type="hidden" value="{{ $video->bvid }}" name="bvid">
|
||||||
|
<textarea name="content" class="hidden">{{ $comment->content }}</textarea>
|
||||||
|
<div class="block my-2 text-center">
|
||||||
|
<input class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" type="submit" value="一键导入评论中的节目单">
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
@endif
|
||||||
|
@endauth
|
||||||
@include("common.footer")
|
@include("common.footer")
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user