master
cody 2 weeks ago
parent 3341c8c191
commit a22eb8cad7

@ -55,9 +55,11 @@ class UserController extends BaseController
{
$all = request()->all();
$list = $this->model->with(underlineToHump($all['show_relation'] ?? []))
->with(['courseSigns' => function ($query) use ($all) {
$query->where('status', 1)->with('course.teacher', 'course.typeDetail');
}])->where(function ($query) use ($all) {
->with([
'courseSigns' => function ($query) use ($all) {
$query->where('status', 1)->with('course.teacher', 'course.typeDetail');
}
])->where(function ($query) use ($all) {
if (isset($all['keyword'])) {
$query->whereHas('courses', function ($q) use ($all) {
$q->where('name', 'like', '%' . $all['keyword'] . '%');
@ -196,13 +198,22 @@ class UserController extends BaseController
$start_date = $year . '-01-01';
$end_date = $year . '-12-31';
$list = $this->model->with('appointments', 'companyIndustryDetail',
'companyPositionDetail', 'companyAreaDetail', 'company')
->with(['courseSigns' => function ($query) {
$query->with('course.typeDetail')->orderBy('fee_status', 'desc');
}])->withCount(['appointments' => function ($query) {
$query->whereIn('status', [0, 1]);
}]);
$list = $this->model->with(
'appointments',
'companyIndustryDetail',
'companyPositionDetail',
'companyAreaDetail',
'company'
)
->with([
'courseSigns' => function ($query) {
$query->with('course.typeDetail')->orderBy('fee_status', 'desc');
}
])->withCount([
'appointments' => function ($query) {
$query->whereIn('status', [0, 1]);
}
]);
// 是否被投企业
if (isset($all['is_yh_invested'])) {
$list = $list->whereHas('company', function ($query) use ($all) {
@ -221,9 +232,16 @@ class UserController extends BaseController
// 新数据
if (isset($all['company_tag'])) {
$list = $list->whereHas('company', function ($query) use ($all) {
foreach (explode(',', $all['company_tag']) as $v) {
$query->orWhere('company_tag', 'like', '%' . $v . '%');
}
$string = explode(',', $all['company_tag']);
$query->where(function ($q) use ($string) {
foreach ($string as $index => $v) {
if ($index === 0) {
$q->where('company_tag', 'like', '%' . trim($v) . '%');
} else {
$q->orWhere('company_tag', 'like', '%' . trim($v) . '%');
}
}
});
});
}
@ -522,7 +540,8 @@ class UserController extends BaseController
} else {
if (in_array($k, ['company_type', 'type'])) {
$list[$key][$k] = str_replace('、', ',', $value[$v]);
$list[$key][$k] = str_replace('', ',', $list[$key][$k]);;
$list[$key][$k] = str_replace('', ',', $list[$key][$k]);
;
} else {
$list[$key][$k] = $value[$v];
}
@ -673,7 +692,7 @@ class UserController extends BaseController
if (isset($all['is_schoolmate'])) {
$data['is_schoolmate'] = $all['is_schoolmate'];
}
// if (isset($all['is_black'])) {
// if (isset($all['is_black'])) {
// $data['is_black'] = $all['is_black'];
// }
$this->model->whereIn('id', $idsArray)->update($data);

Loading…
Cancel
Save