Merge branch 'master' of ssh://47.101.48.251:/data/git/wx.sstbc.com

master
lion 2 weeks ago
commit 54bf61a245

@ -89,6 +89,10 @@ class CompanyController extends BaseController
{ {
$all = request()->all(); $all = request()->all();
$list = $this->model->with(['users' => function ($query) use ($all) { $list = $this->model->with(['users' => function ($query) use ($all) {
$query->whereHas('courseSigns', function ($q) {
$q->where('status', 1);
})->with('courseSigns.course');
}])->whereHas('users', function ($query) use ($all) {
if (isset($all['course_type_id'])) { if (isset($all['course_type_id'])) {
$query->whereHas('courses', function ($q) use ($all) { $query->whereHas('courses', function ($q) use ($all) {
$q->where('type', $all['course_type_id']); $q->where('type', $all['course_type_id']);
@ -105,10 +109,7 @@ class CompanyController extends BaseController
if (isset($all['is_schoolmate'])) { if (isset($all['is_schoolmate'])) {
$query->where('is_schoolmate', $all['is_schoolmate']); $query->where('is_schoolmate', $all['is_schoolmate']);
} }
$query->whereHas('courseSigns', function ($q) { })->where(function ($query) use ($all) {
$q->where('status', 1);
})->with('courseSigns.course');
}])->where(function ($query) use ($all) {
if (isset($all['filter']) && !empty($all['filter'])) { if (isset($all['filter']) && !empty($all['filter'])) {
foreach ($all['filter'] as $condition) { foreach ($all['filter'] as $condition) {
$key = $condition['key'] ?? null; $key = $condition['key'] ?? null;

Loading…
Cancel
Save