master
cody 3 months ago
parent 8eccdc1059
commit 9014993810

@ -74,10 +74,12 @@ class CourseSignController extends BaseController
public function index()
{
$all = request()->all();
$list = $this->model->with(['course.typeDetail', 'thirdAppointmentLogs', 'user' => function ($query) {
$query->with(['courseSigns' => function ($q) {
$q->where('status', 1)->with('course');
}]);
$list = $this->model->with(['course.typeDetail', 'user' => function ($query) use ($all) {
if (isset($all['clear']) && empty($all['clear'])) {
$query->with(['courseSigns' => function ($q) {
$q->where('status', 1)->with('course');
}]);
}
}])->whereHas('user', function ($query) use ($all) {
if (isset($all['is_vip'])) {
$query->where('is_vip', $all['is_vip']);
@ -129,6 +131,9 @@ class CourseSignController extends BaseController
}
}
})->where(function ($query) use ($all) {
if (isset($all['clear']) && empty($all['clear'])) {
$query->with('thirdAppointmentLogs');
}
if (isset($all['start_date'])) {
$query->whereDate('created_at', '>=', $all['start_date']);
}

Loading…
Cancel
Save