|
|
|
@ -624,6 +624,7 @@ class UserController extends BaseController
|
|
|
|
* description="",
|
|
|
|
* description="",
|
|
|
|
* @OA\Parameter(name="ids", in="query", @OA\Schema(type="string"), required=true, description="英文逗号分隔的id数组"),
|
|
|
|
* @OA\Parameter(name="ids", in="query", @OA\Schema(type="string"), required=true, description="英文逗号分隔的id数组"),
|
|
|
|
* @OA\Parameter(name="is_schoolmate", in="query", @OA\Schema(type="string"), required=true, description="是否校友库-0否1是"),
|
|
|
|
* @OA\Parameter(name="is_schoolmate", in="query", @OA\Schema(type="string"), required=true, description="是否校友库-0否1是"),
|
|
|
|
|
|
|
|
* @OA\Parameter(name="is_black", in="query", @OA\Schema(type="string"), required=true, description="是否黑名单-0否1是"),
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
* @OA\Response(
|
|
|
|
* @OA\Response(
|
|
|
|
* response="200",
|
|
|
|
* response="200",
|
|
|
|
@ -637,16 +638,18 @@ class UserController extends BaseController
|
|
|
|
$messages = [
|
|
|
|
$messages = [
|
|
|
|
'ids.required' => '编号必填',
|
|
|
|
'ids.required' => '编号必填',
|
|
|
|
'is_schoolmate.required' => '是否校友库必填',
|
|
|
|
'is_schoolmate.required' => '是否校友库必填',
|
|
|
|
|
|
|
|
'is_black.required' => '是否黑名单必填',
|
|
|
|
];
|
|
|
|
];
|
|
|
|
$validator = Validator::make($all, [
|
|
|
|
$validator = Validator::make($all, [
|
|
|
|
'ids' => 'required',
|
|
|
|
'ids' => 'required',
|
|
|
|
'is_schoolmate' => 'required',
|
|
|
|
'is_schoolmate' => 'required',
|
|
|
|
|
|
|
|
'is_black' => 'required'
|
|
|
|
], $messages);
|
|
|
|
], $messages);
|
|
|
|
if ($validator->fails()) {
|
|
|
|
if ($validator->fails()) {
|
|
|
|
return $this->fail([StarterResponseCode::START_ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
return $this->fail([StarterResponseCode::START_ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$idsArray = explode(',', $all['ids']);
|
|
|
|
$idsArray = explode(',', $all['ids']);
|
|
|
|
$this->model->whereIn('id', $idsArray)->update(['is_schoolmate' => $all['is_schoolmate']]);
|
|
|
|
$this->model->whereIn('id', $idsArray)->update(['is_schoolmate' => $all['is_schoolmate'], 'is_black' => $all['is_black']]);
|
|
|
|
return $this->success('批量更新成功');
|
|
|
|
return $this->success('批量更新成功');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|