diff --git a/app/Http/Controllers/Mobile/UserController.php b/app/Http/Controllers/Mobile/UserController.php index 959112c..daa0be6 100755 --- a/app/Http/Controllers/Mobile/UserController.php +++ b/app/Http/Controllers/Mobile/UserController.php @@ -274,16 +274,18 @@ class UserController extends CommonController $course_signs->qrcode = ($qrcode !== false && $qrcode !== null) ? $qrcode : null; } // 是否有资格进入校友库 - $enter_schoolmate = User::whereHas('courseSigns', function ($query) { - $query->where('status', 1) - ->where(function ($schoolmateQuery) { - $schoolmateQuery->where('fee_status', 1) - ->orWhereHas('course', function ($courseQuery) { + $enter_schoolmate = User::where('id', $this->getUserId()) + ->whereHas('courseSigns', function ($query) { + $query->where('status', 1) + ->where(function ($schoolmateQuery) { + $schoolmateQuery->whereHas('course', function ($courseQuery) { + $courseQuery->where('is_fee', 1); + })->orWhereHas('course', function ($courseQuery) { $courseQuery->where('is_fee', 0) ->where('free_enter_schoolmate', 1); }); - }); - })->where('id', $this->getUserId())->count(); + }); + })->exists(); if($this->getUserId() == 7490){ $enter_schoolmate = 1; }