diff --git a/app/Models/CourseSign.php b/app/Models/CourseSign.php index 92866cd..b8e2d19 100755 --- a/app/Models/CourseSign.php +++ b/app/Models/CourseSign.php @@ -110,14 +110,14 @@ class CourseSign extends SoftDeletesModel $courseSignByType = CourseSign::whereDate('created_at', '>=', $start_date) ->whereDate('created_at', '<=', $end_date) ->whereHas('user', function ($query) use ($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); -// } -// } + 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)) { $query->where('status', $status); diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 22204b7..33c3930 100755 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -28,22 +28,22 @@ class EventServiceProvider extends ServiceProvider */ public function boot() { - DB::listen( - function ($query) { - $tmp = str_replace('?', '"' . '%s' . '"', $query->sql); - $qBindings = []; - foreach ($query->bindings as $key => $value) { - if (is_numeric($key)) { - $qBindings[] = $value; - } else { - $tmp = str_replace(':' . $key, '"' . $value . '"', $tmp); - } - } - $tmp = vsprintf($tmp, $qBindings); - $tmp = str_replace("\\", "", $tmp); - Log::info(' execution time: ' . $query->time . 'ms; ' . $tmp . "\n\t"); - } - ); +// DB::listen( +// function ($query) { +// $tmp = str_replace('?', '"' . '%s' . '"', $query->sql); +// $qBindings = []; +// foreach ($query->bindings as $key => $value) { +// if (is_numeric($key)) { +// $qBindings[] = $value; +// } else { +// $tmp = str_replace(':' . $key, '"' . $value . '"', $tmp); +// } +// } +// $tmp = vsprintf($tmp, $qBindings); +// $tmp = str_replace("\\", "", $tmp); +// Log::info(' execution time: ' . $query->time . 'ms; ' . $tmp . "\n\t"); +// } +// ); } /**