|
|
|
|
@ -242,7 +242,7 @@ class UserController extends BaseController
|
|
|
|
|
if (isset($all['is_vip'])) {
|
|
|
|
|
$query->where('is_vip', $all['is_vip']);
|
|
|
|
|
}
|
|
|
|
|
if(isset($all['is_black'])){
|
|
|
|
|
if (isset($all['is_black'])) {
|
|
|
|
|
$query->where('is_black', $all['is_black']);
|
|
|
|
|
}
|
|
|
|
|
if (isset($all['type'])) {
|
|
|
|
|
@ -641,19 +641,22 @@ class UserController extends BaseController
|
|
|
|
|
$all = \request()->all();
|
|
|
|
|
$messages = [
|
|
|
|
|
'ids.required' => '编号必填',
|
|
|
|
|
'is_schoolmate.required' => '是否校友库必填',
|
|
|
|
|
'is_black.required' => '是否黑名单必填',
|
|
|
|
|
];
|
|
|
|
|
$validator = Validator::make($all, [
|
|
|
|
|
'ids' => 'required',
|
|
|
|
|
'is_schoolmate' => 'required',
|
|
|
|
|
'is_black' => 'required'
|
|
|
|
|
], $messages);
|
|
|
|
|
if ($validator->fails()) {
|
|
|
|
|
return $this->fail([StarterResponseCode::START_ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
|
}
|
|
|
|
|
$idsArray = explode(',', $all['ids']);
|
|
|
|
|
$this->model->whereIn('id', $idsArray)->update(['is_schoolmate' => $all['is_schoolmate'], 'is_black' => $all['is_black']]);
|
|
|
|
|
$data = [];
|
|
|
|
|
if (isset($all['is_schoolmate'])) {
|
|
|
|
|
$data['is_schoolmate'] = $all['is_schoolmate'];
|
|
|
|
|
}
|
|
|
|
|
if (isset($all['is_black'])) {
|
|
|
|
|
$data['is_black'] = $all['is_black'];
|
|
|
|
|
}
|
|
|
|
|
$this->model->whereIn('id', $idsArray)->update($data);
|
|
|
|
|
return $this->success('批量更新成功');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|