From 3247accbf0202d270b213dbef6835f4ac2da2a37 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Thu, 4 Sep 2025 17:22:56 +0800 Subject: [PATCH] update --- app/Http/Controllers/Mobile/UserController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Mobile/UserController.php b/app/Http/Controllers/Mobile/UserController.php index fe6c490..098c2ee 100755 --- a/app/Http/Controllers/Mobile/UserController.php +++ b/app/Http/Controllers/Mobile/UserController.php @@ -591,11 +591,7 @@ class UserController extends CommonController } // 监测是否正常报名并通过 $courseSigns = CourseSign::where('course_id', $all['course_id']) - ->where(function ($query) use ($all) { - if (isset($all['course_content_id'])) { - $query->where('course_content_id', $all['course_content_id']); - } - })->whereHas('user', function ($query) use ($all) { + ->whereHas('user', function ($query) use ($all) { $query->where('mobile', $all['mobile']); })->where('status', 1) ->first(); @@ -604,7 +600,11 @@ class UserController extends CommonController } $user = User::where('mobile', $all['mobile'])->first(); $list = CourseContentCheck::where('course_id', $all['course_id']) - ->where('user_id', $user->id) + ->where(function ($query) use ($all) { + if (isset($all['course_content_id'])) { + $query->where('course_content_id', $all['course_content_id']); + } + })->where('user_id', $user->id) ->orderBy('created_at', 'desc') ->get(); if ($list->isNotEmpty()) {