You've already forked lubo_comment_query
							
							样式,排序,翻页保留查询条件,继续抽象
This commit is contained in:
		| @@ -19,7 +19,7 @@ class CommentQueryController extends BaseController | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         $comments = $query->paginate(10); | ||||
|         $comments = $query->paginate(10)->withQueryString(); | ||||
|         return view("index", [ | ||||
|             "keyword" => $keyword, | ||||
|             "comments" => $comments, | ||||
|   | ||||
| @@ -14,7 +14,7 @@ class DanmakuQueryController extends BaseController | ||||
|         $video_list = Videos::query() | ||||
|             ->withCount("danmakus", "bilibili_danmakus", "ixigua_danmakus", "douyin_danmakus") | ||||
|             ->orderByDesc("created_at") | ||||
|             ->paginate(10); | ||||
|             ->paginate(10)->withQueryString(); | ||||
|         return view("danmaku.index", [ | ||||
|             "video_list" => $video_list, | ||||
|         ]); | ||||
| @@ -35,7 +35,7 @@ class DanmakuQueryController extends BaseController | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         $danmakus = $query->orderBy("created_at", "asc")->paginate(20); | ||||
|         $danmakus = $query->orderBy("created_at", "asc")->paginate(20)->withQueryString(); | ||||
|         return view("danmaku.search_index", [ | ||||
|             "keyword" => $keyword, | ||||
|             "video" => $video, | ||||
|   | ||||
| @@ -12,7 +12,7 @@ class ProgramQueryController extends BaseController | ||||
|         $keyword = $request->get("keyword", ""); | ||||
|         $programs = Programs::query()->with(["appends", "video_pivots.video"]) | ||||
|             ->where("status", "=", 1)->limit(15)->orderByDesc("created_at") | ||||
|             ->paginate(); | ||||
|             ->paginate(10)->withQueryString(); | ||||
|         return view("program.index", [ | ||||
|             "keyword" => $keyword, | ||||
|             "programs"=>$programs, | ||||
|   | ||||
| @@ -15,7 +15,7 @@ class Programs extends Model | ||||
| 
 | ||||
|     public function video_pivots(): \Illuminate\Database\Eloquent\Relations\HasMany | ||||
|     { | ||||
|         return $this->hasMany(ProgramVideos::class, "program_id", "id")->orderBy("created_at"); | ||||
|         return $this->hasMany(ProgramVideos::class, "program_id", "id")->orderByDesc("created_at"); | ||||
|     } | ||||
| 
 | ||||
|     public function videos(): \Illuminate\Database\Eloquent\Relations\HasManyThrough | ||||
|   | ||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -1,4 +1,4 @@ | ||||
| { | ||||
|     "/js/app.js": "/js/app.js?id=f775b77a8886d46e619d4d79272ec38d", | ||||
|     "/css/app.css": "/css/app.css?id=3b9c308b6dc460a0dfe4535c4c94ab78" | ||||
|     "/css/app.css": "/css/app.css?id=e45f0e1f4819e8fc855349a3302912d2" | ||||
| } | ||||
|   | ||||
| @@ -28,26 +28,24 @@ | ||||
|             </td> | ||||
|             <td>{{$video_pivot->created_at}}</td> | ||||
|             <td> | ||||
|                 <a class="underline block" target="_blank" | ||||
|                    href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->start_part}}&t={{$video_pivot->start_sec}}" | ||||
|                    title="P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}" | ||||
|                 >P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</a>
 | ||||
|                 @if($video_pivot->start_image) | ||||
|                     <img width="300" src="{{$video_pivot->start_image}}" alt="开始时的画面"> | ||||
|                 @else | ||||
|                     <div>暂无</div> | ||||
|                 @endif | ||||
|                 <x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->start_part" :time="$video_pivot->start_time"> | ||||
|                     <div>{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
 | ||||
|                     @if($video_pivot->start_image) | ||||
|                         <img width="300" src="{{$video_pivot->start_image}}" alt="开始时的画面"> | ||||
|                     @else | ||||
|                         节目开始位置 | ||||
|                     @endif | ||||
|                 </x-links.video_link> | ||||
|             </td> | ||||
|             <td> | ||||
|                 <a class="underline" target="_blank" | ||||
|                    href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->stop_part}}&t={{$video_pivot->stop_sec}}" | ||||
|                    title="P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}" | ||||
|                 >P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</a>
 | ||||
|                 @if($video_pivot->stop_image) | ||||
|                     <img width="300" src="{{$video_pivot->stop_image}}" alt="结束时的画面"> | ||||
|                 @else | ||||
|                     <div>暂无</div> | ||||
|                 @endif | ||||
|                 <x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->stop_part" :time="$video_pivot->stop_time"> | ||||
|                     <div>P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
 | ||||
|                     @if($video_pivot->start_image) | ||||
|                         <img width="300" src="{{$video_pivot->stop_image}}" alt="结束时的画面"> | ||||
|                     @else | ||||
|                         节目结束位置 | ||||
|                     @endif | ||||
|                 </x-links.video_link> | ||||
|             </td> | ||||
|             <td> | ||||
|                 <a class="text-blue-600 underline" | ||||
|   | ||||
| @@ -25,19 +25,19 @@ | ||||
|     <tbody> | ||||
|     @foreach($programs as $program) | ||||
|         <tr> | ||||
|             <td class="border align-top"> | ||||
|             <td class="border align-top w-1/2 lg:w-1/4"> | ||||
|                 <a class="text-blue-600 lg:text-current underline lg:no-underline" href="/programs/{{ $program->id }}/video"> | ||||
|                     <span title="节目">{{$program->name}}</span> | ||||
|                     <span title="难度">{{$program->difficulty}}</span> | ||||
|                     <span title="要求">{{$program->desc}}</span> | ||||
|                 </a> | ||||
|             </td> | ||||
|             <td class="border align-top"> | ||||
|             <td class="border align-top w-1/2 lg:w-1/4"> | ||||
|                 @foreach($program->appends as $append) | ||||
|                     <x-append :append="$append"></x-append> | ||||
|                 @endforeach | ||||
|             </td> | ||||
|             <td class="border align-top hidden lg:table-cell"> | ||||
|             <td class="border align-top hidden lg:table-cell lg:w-1/4"> | ||||
|                 @foreach($program->video_pivots as $video_pivot) | ||||
|                     <x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->start_part" :time="$video_pivot->start_time"> | ||||
|                         <div>{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
 | ||||
| @@ -49,7 +49,7 @@ | ||||
|                     </x-links.video_link> | ||||
|                 @endforeach | ||||
|             </td> | ||||
|             <td class="border align-top hidden lg:table-cell"> | ||||
|             <td class="border align-top hidden lg:table-cell lg:w-1/4"> | ||||
|                 @foreach($program->video_pivots as $video_pivot) | ||||
|                     <x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->stop_part" :time="$video_pivot->stop_time"> | ||||
|                         <div>P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
 | ||||
|   | ||||
| @@ -15,57 +15,12 @@ | ||||
|     </div> | ||||
|     <div class="ml-2"> | ||||
|         @foreach($program->appends as $append) | ||||
|             @if($append->is_original) | ||||
|                 <div> | ||||
|                     @switch($append->platform_id) | ||||
|                         @case(1) | ||||
|                             <img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/bilibili.ico" alt="B站"> | ||||
|                             <a class="underline" href="https://space.bilibili.com/{{$append->from_mid}}" target="_blank">{{$append->from}}</a> | ||||
|                             @break | ||||
|                         @case(2) | ||||
|                             <img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/ixigua.ico" alt="西瓜视频"> | ||||
|                             <a class="underline" href="https://www.ixigua.com/home/{{$append->from_mid}}/" target="_blank">{{$append->from}}</a> | ||||
|                             @break | ||||
|                         @case(3) | ||||
|                             <img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/douyin.ico" alt="抖音"> | ||||
|                             {{$append->from}} | ||||
|                             @break | ||||
|                         @default | ||||
|                             {{$append->from}} | ||||
|                             @break | ||||
|                     @endswitch | ||||
|                     老板点播 | ||||
|                     <span title="一分10块">{{$append->price}}分</span> | ||||
|                     @if($append->append) | ||||
|                         <span>({{$append->append}})</span> | ||||
|                     @endif | ||||
|                 </div> | ||||
|             @else | ||||
|                 <div> | ||||
|                     @switch($append->platform_id) | ||||
|                         @case(1) | ||||
|                             <img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/bilibili.ico" alt="B站"> | ||||
|                             <a class="underline" href="https://space.bilibili.com/{{$append->from_mid}}" target="_blank">{{$append->from}}</a> | ||||
|                             @break | ||||
|                         @case(2) | ||||
|                             <img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/ixigua.ico" alt="西瓜视频"> | ||||
|                             <a class="underline" href="https://www.ixigua.com/home/{{$append->from_mid}}/" target="_blank">{{$append->from}}</a> | ||||
|                             @break | ||||
|                         @case(3) | ||||
|                             <img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/douyin.ico" alt="抖音"> | ||||
|                             {{$append->from}} | ||||
|                             @break | ||||
|                         @default | ||||
|                             {{$append->from}} | ||||
|                             @break | ||||
|                     @endswitch | ||||
|                     老板追加:{{$append->name}} | ||||
|                     <span title="一分10块">{{$append->price}}分</span> | ||||
|                     @if($append->append) | ||||
|                         <span>({{$append->append}})</span> | ||||
|                     @endif | ||||
|                 </div> | ||||
|             @endif | ||||
|             <x-append :append="$append"></x-append> | ||||
|         @endforeach | ||||
|     </div> | ||||
|     <div> | ||||
|         @foreach($videos as $video_pivot) | ||||
|             <a class="text-blue-600" href="{{url("/danmakus/".$video_pivot->video_bvid)}}">查看弹幕</a> | ||||
|         @endforeach | ||||
|     </div> | ||||
| </div> | ||||
| @@ -80,32 +35,24 @@ | ||||
|     @foreach($videos as $video_pivot) | ||||
|         <tr class="border"> | ||||
|             <td class="border align-bottom"> | ||||
|                 <a class="block" | ||||
|                    target="_blank" | ||||
|                    href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->start_part}}&t={{$video_pivot->start_sec}}" | ||||
|                    title="P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}" | ||||
|                 > | ||||
|                 <x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->start_part" :time="$video_pivot->start_time"> | ||||
|                     <div>{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
 | ||||
|                     @if($video_pivot->start_image) | ||||
|                         <img width="300" src="{{$video_pivot->start_image}}" alt="开始时的画面"> | ||||
|                     @else | ||||
|                         节目开始位置 | ||||
|                     @endif | ||||
|                 </a> | ||||
|                 </x-links.video_link> | ||||
|             </td> | ||||
|             <td class="border align-bottom"> | ||||
|                 <a class="block" | ||||
|                    target="_blank" | ||||
|                    href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->stop_part}}&t={{$video_pivot->stop_sec}}" | ||||
|                    title="P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}" | ||||
|                 > | ||||
|                 <x-links.video_link :bvid="$video_pivot->video_bvid" :part="$video_pivot->stop_part" :time="$video_pivot->stop_time"> | ||||
|                     <div>P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
 | ||||
|                     @if($video_pivot->start_image) | ||||
|                         <img width="300" src="{{$video_pivot->stop_image}}" alt="结束时的画面"> | ||||
|                     @else | ||||
|                         节目结束位置 | ||||
|                     @endif | ||||
|                 </a> | ||||
|                 </x-links.video_link> | ||||
|             </td> | ||||
|         </tr> | ||||
|     @endforeach | ||||
|   | ||||
		Reference in New Issue
	
	Block a user