|
|
|
|
@ -60,7 +60,7 @@ class CourseController extends BaseController
|
|
|
|
|
$list = $this->model->with(underlineToHump($all['show_relation'] ?? []))
|
|
|
|
|
->withCount([
|
|
|
|
|
'courseSigns' => function ($query) {
|
|
|
|
|
$query->whereNotIn('status', [4, 5]);
|
|
|
|
|
$query->whereNotIn('status', [4, 5])->whereHas('user');
|
|
|
|
|
}
|
|
|
|
|
])->withCount([
|
|
|
|
|
'courseSigns as sign_pass_total' => function ($query) {
|
|
|
|
|
@ -258,7 +258,11 @@ class CourseController extends BaseController
|
|
|
|
|
if ($validator->fails()) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
|
}
|
|
|
|
|
$detail = $this->model->withCount('courseSigns')->with(underlineToHump($all['show_relation'] ?? []))->find($all['id']);
|
|
|
|
|
$detail = $this->model->withCount([
|
|
|
|
|
'courseSigns' => function ($query) {
|
|
|
|
|
$query->whereHas('user');
|
|
|
|
|
}
|
|
|
|
|
])->with(underlineToHump($all['show_relation'] ?? []))->find($all['id']);
|
|
|
|
|
if ($detail) {
|
|
|
|
|
$detail->setAppends(array_values(array_diff($detail->getAppends(), ['qrcode'])));
|
|
|
|
|
}
|
|
|
|
|
|