You've already forked lubo_comment_query
							
							优化一键导入功能
This commit is contained in:
		| @@ -4,6 +4,7 @@ namespace App\Http\Controllers; | |||||||
| 
 | 
 | ||||||
| use App\Models\Programs; | use App\Models\Programs; | ||||||
| use App\Models\ProgramVideos; | use App\Models\ProgramVideos; | ||||||
|  | use App\Models\VideoComments; | ||||||
| use Illuminate\Http\Request; | use Illuminate\Http\Request; | ||||||
| use Illuminate\Routing\Controller as BaseController; | use Illuminate\Routing\Controller as BaseController; | ||||||
| 
 | 
 | ||||||
| @@ -36,6 +37,13 @@ class ProgramConstructController extends BaseController | |||||||
|         return redirect(route("program.construct.edit", ["program"=>$program->id])); |         return redirect(route("program.construct.edit", ["program"=>$program->id])); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     public function from_comment(Request $request, VideoComments $comment) { | ||||||
|  |         return redirect(route("program.construct.batch_add"))->withInput([ | ||||||
|  |             "bvid"=>$comment->video->bvid, | ||||||
|  |             "content"=>$comment->content | ||||||
|  |         ]); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|     public function batch_add(Request $request) { |     public function batch_add(Request $request) { | ||||||
|         return view("program.construct.batch_add"); |         return view("program.construct.batch_add"); | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -63,13 +63,7 @@ | |||||||
| </table> | </table> | ||||||
| @auth("web") | @auth("web") | ||||||
| @if(sizeof($video_pivots) === 0 && $comment) | @if(sizeof($video_pivots) === 0 && $comment) | ||||||
|     <form action="{{ url(route("program.construct.batch_create")) }}" method="post" enctype="multipart/form-data"> |     <a href="{{ url(route("program.construct.from_comment", ["comment"=>$comment->id])) }}" class="px-6 py-2 inline-block rounded-full bg-cyan-600 text-white">一键导入评论中的节目单</a> | ||||||
|         <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 | @endif | ||||||
| @endauth | @endauth | ||||||
| @include("common.footer") | @include("common.footer") | ||||||
|   | |||||||
| @@ -37,6 +37,7 @@ Route::prefix("/programs/construct")->middleware("auth:web")->group(function (Ro | |||||||
|     $router->get('/', ["\\App\\Http\\Controllers\\ProgramConstructController","index"])->name("program.construct.list"); |     $router->get('/', ["\\App\\Http\\Controllers\\ProgramConstructController","index"])->name("program.construct.list"); | ||||||
|     $router->get('/add', ["\\App\\Http\\Controllers\\ProgramConstructController","add"])->name("program.construct.add"); |     $router->get('/add', ["\\App\\Http\\Controllers\\ProgramConstructController","add"])->name("program.construct.add"); | ||||||
|     $router->post('/add', ["\\App\\Http\\Controllers\\ProgramConstructController","create"])->name("program.construct.create"); |     $router->post('/add', ["\\App\\Http\\Controllers\\ProgramConstructController","create"])->name("program.construct.create"); | ||||||
|  |     $router->get('/from_comment/{comment}', ["\\App\\Http\\Controllers\\ProgramConstructController","from_comment"])->name("program.construct.from_comment"); | ||||||
|     $router->get('/batch', ["\\App\\Http\\Controllers\\ProgramConstructController","batch_add"])->name("program.construct.batch_add"); |     $router->get('/batch', ["\\App\\Http\\Controllers\\ProgramConstructController","batch_add"])->name("program.construct.batch_add"); | ||||||
|     $router->post('/batch', ["\\App\\Http\\Controllers\\ProgramConstructController","batch_create"])->name("program.construct.batch_create"); |     $router->post('/batch', ["\\App\\Http\\Controllers\\ProgramConstructController","batch_create"])->name("program.construct.batch_create"); | ||||||
|     $router->get('/{program}', ["\\App\\Http\\Controllers\\ProgramConstructController","edit"])->name("program.construct.edit"); |     $router->get('/{program}', ["\\App\\Http\\Controllers\\ProgramConstructController","edit"])->name("program.construct.edit"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user