From 4369ba735e8a97f06573d44119610ee54a1984d2 Mon Sep 17 00:00:00 2001 From: cody <648753004@qq.com> Date: Thu, 13 Nov 2025 14:10:04 +0800 Subject: [PATCH] update --- app/Models/CourseSign.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Models/CourseSign.php b/app/Models/CourseSign.php index 145b9b4..94f8809 100755 --- a/app/Models/CourseSign.php +++ b/app/Models/CourseSign.php @@ -82,7 +82,7 @@ class CourseSign extends SoftDeletesModel $total = CourseSign::whereDate('created_at', '>=', $start_date) ->whereDate('created_at', '<=', $end_date) ->whereHas('user', function ($query) use ($area) { - if ($area) { + if (isset($area)) { if ($area == '苏州市外') { $allArea = ParameterDetail::where('parameter_id', 5)->get(); $query->whereNotIn('company_area', $allArea->pluck('value')); @@ -110,11 +110,13 @@ class CourseSign extends SoftDeletesModel $courseSignByType = CourseSign::whereDate('created_at', '>=', $start_date) ->whereDate('created_at', '<=', $end_date) ->whereHas('user', function ($query) use ($area) { - if ($area == '苏州市外') { - $allArea = ParameterDetail::where('parameter_id', 5)->get(); - $query->whereNotIn('company_area', $allArea->pluck('value')); - } else { - $query->where('company_area', $area); + if (isset($area)) { + if ($area == '苏州市外') { + $allArea = ParameterDetail::where('parameter_id', 5)->get(); + $query->whereNotIn('company_area', $allArea->pluck('value')); + } else { + $query->where('company_area', $area); + } } })->where(function ($query) use ($status, $course_ids) { if (isset($status)) {