建设支持分页,节目列表添加开打时间,暂时停止使用cdn

This commit is contained in:
Jerry Yan 2022-07-31 11:19:23 +08:00
parent 315f3e6cce
commit 16fba66527
6 changed files with 12 additions and 5 deletions

View File

@ -10,7 +10,8 @@ class ProgramConstructController extends BaseController
{ {
public function construct(Request $request) { public function construct(Request $request) {
$status = $request->get("status", "0"); $status = $request->get("status", "0");
$programs = Programs::query()->with(["appends", "video_pivots.video"])->where("status", $status, 0)->limit(15)->orderByDesc("created_at")->get(); $query = Programs::query()->with(["appends", "video_pivots.video"])->where("status", $status, 0)->orderByDesc("created_at");
$programs = $query->paginate(10)->withQueryString();;
return view("program.construct.index", [ return view("program.construct.index", [
"programs"=>$programs, "programs"=>$programs,
]); ]);

View File

@ -29,13 +29,15 @@ class ProgramVideoConstructController extends BaseController
$file = $request->file("start_image"); $file = $request->file("start_image");
$path = $file->store("lubo_file"); $path = $file->store("lubo_file");
$full_path = Storage::url($path); $full_path = Storage::url($path);
$program_video->start_image = str_replace("jerryyan.top", "jerryyan.net", $full_path); // $program_video->start_image = str_replace("jerryyan.top", "jerryyan.net", $full_path);
$program_video->start_image = $full_path;
} }
if ($request->hasFile("stop_image")) { if ($request->hasFile("stop_image")) {
$file = $request->file("stop_image"); $file = $request->file("stop_image");
$path = $file->store("lubo_file"); $path = $file->store("lubo_file");
$full_path = Storage::url($path); $full_path = Storage::url($path);
$program_video->stop_image = str_replace("jerryyan.top", "jerryyan.net", $full_path); // $program_video->stop_image = str_replace("jerryyan.top", "jerryyan.net", $full_path);
$program_video->stop_image = $full_path;
} }
$program_video->created_at = $request->post("created_at"); $program_video->created_at = $request->post("created_at");
$program_video->update($updatePayload); $program_video->update($updatePayload);

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{ {
"/js/app.js": "/js/app.js?id=f775b77a8886d46e619d4d79272ec38d", "/js/app.js": "/js/app.js?id=f775b77a8886d46e619d4d79272ec38d",
"/css/app.css": "/css/app.css?id=c58f06539c8528f7709ea13ec177a0ec" "/css/app.css": "/css/app.css?id=5963396c80ec91a728607097a8057095"
} }

View File

@ -58,6 +58,7 @@
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
{{ $programs->links() }}
@include("common.footer") @include("common.footer")
</body> </body>
</html> </html>

View File

@ -26,6 +26,9 @@
@foreach($programs as $program) @foreach($programs as $program)
<tr> <tr>
<td class="border align-top w-1/2 lg:w-1/4"> <td class="border align-top w-1/2 lg:w-1/4">
@if(sizeof($program->video_pivots) > 0)
<div class="block lg:hidden">{{$program->created_at}}</div>
@endif
<a class="text-blue-600 lg:text-current underline lg:no-underline" href="/programs/{{ $program->id }}/video"> <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->name}}</span>
<span title="难度">{{$program->difficulty}}</span> <span title="难度">{{$program->difficulty}}</span>