From cd2ccdec8742d38e07379ab60ca6e5493e84ca21 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 12 Jul 2022 10:45:06 +0800 Subject: [PATCH] =?UTF-8?q?request=E5=86=99=E6=B3=95=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/CommentQueryController.php | 5 +++-- app/Http/Controllers/ProgramQueryController.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/CommentQueryController.php b/app/Http/Controllers/CommentQueryController.php index bbb9886..32ec65d 100644 --- a/app/Http/Controllers/CommentQueryController.php +++ b/app/Http/Controllers/CommentQueryController.php @@ -3,12 +3,13 @@ namespace App\Http\Controllers; use App\Models\VideoComments; +use Illuminate\Http\Request; use Illuminate\Routing\Controller as BaseController; class CommentQueryController extends BaseController { - public function index() { - $keyword = request()->get("keyword", ""); + public function index(Request $request) { + $keyword = $request->get("keyword", ""); $query = VideoComments::query()->where("is_top", "=", 1)->with("video")->orderByDesc("created_at"); if ($keyword) { $keyword_split = explode(" ", $keyword); diff --git a/app/Http/Controllers/ProgramQueryController.php b/app/Http/Controllers/ProgramQueryController.php index 8b46d1f..cb9f73c 100644 --- a/app/Http/Controllers/ProgramQueryController.php +++ b/app/Http/Controllers/ProgramQueryController.php @@ -3,12 +3,13 @@ namespace App\Http\Controllers; use App\Models\Programs; +use Illuminate\Http\Request; use Illuminate\Routing\Controller as BaseController; class ProgramQueryController extends BaseController { - public function index() { - $keyword = request()->get("keyword", ""); + public function index(Request $request) { + $keyword = $request->get("keyword", ""); $programs = Programs::query()->with(["appends", "video_pivots.video"])->limit(15)->orderByDesc("created_at")->get(); return view("program", [ "keyword" => $keyword,