You've already forked lubo_comment_query
							
							自动修复逻辑,对应按钮
This commit is contained in:
		| @@ -108,7 +108,7 @@ class ProgramConstructController extends BaseController | ||||
|                 "content" => $e->getMessage() | ||||
|             ]); | ||||
|         } | ||||
|         ProgramVideoUtil::fix_created_at_by_part_info($bvid); | ||||
|         ProgramVideoUtil::fix_created_at_by_part_info($bvid, true); | ||||
|         return redirect(route("program.construct.list")); | ||||
|     } | ||||
| 
 | ||||
|   | ||||
| @@ -107,7 +107,7 @@ class ProgramVideoConstructController extends BaseController | ||||
|                 "id" => "没有开始时间,请先保存对应时间" | ||||
|             ]); | ||||
|         } | ||||
|         return view("program.construct.video.time_fix", [ | ||||
|         return view("program.construct.video.manual_fix", [ | ||||
|             "program_video" => $program_video | ||||
|         ]); | ||||
|     } | ||||
| @@ -127,4 +127,16 @@ class ProgramVideoConstructController extends BaseController | ||||
|         ProgramVideoUtil::fix_created_at_by_manual($program_video, $each_time_sec); | ||||
|         return redirect(route("program.construct.list")); | ||||
|     } | ||||
| 
 | ||||
|     public function auto_fix_created_at(Request $request, string $bvid) | ||||
|     { | ||||
|         $result = ProgramVideoUtil::fix_created_at_by_part_info($bvid, true); | ||||
|         if ($result) { | ||||
|             return redirect(route("program.construct.list")); | ||||
|         } else { | ||||
|             return back()->withErrors([ | ||||
|                 "video_bvid" => "自动修复失败" | ||||
|             ]); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -86,6 +86,7 @@ class ProgramVideoUtil | ||||
|                             $program_video->stop_part = $video_parts->pluck("part_num")->max(); | ||||
|                         } | ||||
|                     } | ||||
|                     $program_video->save(); | ||||
|                 } | ||||
|             } | ||||
|             DB::commit(); | ||||
|   | ||||
| @@ -51,7 +51,7 @@ | ||||
|     <div class="block my-2 text-center"> | ||||
|         <input class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" type="submit"> | ||||
|     </div> | ||||
|     @if($program_video->video_bvid) | ||||
|     @if($program_video->video) | ||||
|     <div class="block my-2"> | ||||
|         <a class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" target="_blank" | ||||
|            href="https://www.bilibili.com/video/{{$program_video->video_bvid}}?p={{$program_video->start_part}}&t={{$program_video->start_sec}}" | ||||
| @@ -61,9 +61,16 @@ | ||||
|            href="https://www.bilibili.com/video/{{$program_video->video_bvid}}?p={{$program_video->stop_part}}&t={{$program_video->stop_sec}}" | ||||
|            title="P{{$program_video->stop_part}}#{{$program_video->stop_time}}" | ||||
|         >打开至结束位置</a> | ||||
|         @if($program_video->created_at) | ||||
|         <a class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" | ||||
|            href="{{ url(route("program.construct.video.batch_fix_created_at", ["program_video" => $program_video->id])) }}" | ||||
|         >去批量修复开打时间</a> | ||||
|            href="{{ url(route("program.construct.video.manual_fix_created_at.view", ["program_video" => $program_video->id])) }}" | ||||
|         >手动修复开打时间</a> | ||||
|         @endif | ||||
|         @if($program_video->video->parts()->count() > 0) | ||||
|         <a class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white" | ||||
|            href="{{ url(route("program.construct.video.auto_fix_created_at", ["bvid" => $program_video->video_bvid])) }}" | ||||
|         >自动修复</a> | ||||
|         @endif | ||||
|     </div> | ||||
|     @endif | ||||
| </form> | ||||
|   | ||||
							
								
								
									
										40
									
								
								resources/views/program/construct/video/manual_fix.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								resources/views/program/construct/video/manual_fix.blade.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | ||||
| <html lang="zh"> | ||||
| <head> | ||||
|     <meta charset="UTF-8"> | ||||
|     <title>录播节目关联视频位置修改</title> | ||||
|     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||
|     <link href="{{ mix('/css/app.css') }}" rel="stylesheet"/> | ||||
| </head> | ||||
| <body> | ||||
| @include("common.header") | ||||
| <form class="w-full lg:w-1/2 lg:ml-6 border-2" action="" method="post" enctype="multipart/form-data"> | ||||
|     <div class="text-lg font-bold">时间基准信息</div> | ||||
|     <input type="hidden" name="id" value="{{$program_video->id}}"> | ||||
|     <label class="block my-2"> | ||||
|         BVID | ||||
|         <input class="form-input border-0 border-b-2 w-full" disabled type="text" name="video_bvid" value="{{ $program_video->video_bvid }}"> | ||||
|     </label> | ||||
|     <label class="block my-2"> | ||||
|         开始P数 | ||||
|         <input class="form-input border-0 border-b-2 w-full" disabled type="number" name="start_part" value="{{ $program_video->start_part }}"> | ||||
|     </label> | ||||
|     <label class="block my-2"> | ||||
|         开始时间 | ||||
|         <input class="form-input border-0 border-b-2 w-full" disabled step="1" type="time" name="start_time" value="{{ $program_video->start_time }}"> | ||||
|     </label> | ||||
|     <label class="block my-2"> | ||||
|         节目开打时间 | ||||
|         <input class="form-input border-0 border-b-2 w-full" disabled type="datetime-local" step="1" name="created_at" value="{{ $program_video->created_at }}"> | ||||
|     </label> | ||||
|     <label class="block my-2"> | ||||
|         每P时间 | ||||
|         <input class="form-input border-0 border-b-2 w-full" type="time" step="1" name="each_time" value="{{ old("each_time") }}"> | ||||
|     </label> | ||||
|     @include("common.form_error") | ||||
|     <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> | ||||
| @include("common.footer") | ||||
| </body> | ||||
| </html> | ||||
| @@ -48,8 +48,9 @@ Route::prefix("/programs/construct")->middleware("auth:web")->group(function (Ro | ||||
|     $router->post("/{program}/video/add", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","create"])->name("program.construct.video.create"); | ||||
|     $router->get("/video/{program_video}", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","edit"])->name("program.construct.video.edit"); | ||||
|     $router->post("/video/{program_video}", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","submit"])->name("program.construct.video.submit"); | ||||
|     $router->get("/video/{program_video}/batch_fix", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","to_fix_created_at"])->name("program.construct.video.batch_fix_created_at"); | ||||
|     $router->post("/video/{program_video}/batch_fix", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","fix_created_at_base_on"])->name("program.construct.video.batch_fix_created_at.submit"); | ||||
|     $router->get("/video/{program_video}/manual_fix", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","to_fix_created_at"])->name("program.construct.video.manual_fix_created_at.view"); | ||||
|     $router->post("/video/{program_video}/manual_fix", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","fix_created_at_base_on"])->name("program.construct.video.manual_fix_created_at"); | ||||
|     $router->get("/video/fix/{bvid}", ["\\App\\Http\\Controllers\\ProgramVideoConstructController","auto_fix_created_at"])->name("program.construct.video.auto_fix_created_at"); | ||||
|     // 节目关联点播建设
 | ||||
|     $router->get('/{program}/append', ["\\App\\Http\\Controllers\\ProgramAppendConstructController","index"])->name("program.construct.append.list"); | ||||
|     $router->get('/{program}/append/add', ["\\App\\Http\\Controllers\\ProgramAppendConstructController","add"])->name("program.construct.append.add"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user