接单员与财务管理
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Runner\Http\Requests;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
use Modules\Common\Http\Requests\BaseFormRequest;
|
||||
|
||||
class RunnerApplicationFormRequest extends BaseFormRequest
|
||||
{
|
||||
protected $stopOnFirstFailure = true;
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
if (!$this->isUpdate()) {
|
||||
return [
|
||||
'user_id' => 'required|integer|exists:user,id',
|
||||
'real_name' => 'required|string|max:30',
|
||||
'mobile' => 'required|string|max:20',
|
||||
'resume' => 'nullable|string|max:500',
|
||||
'id_card' => 'required|string|size:18',
|
||||
'id_card_front' => 'nullable|string|max:255',
|
||||
'id_card_back' => 'nullable|string|max:255',
|
||||
'status' => 'nullable|integer|in:0,1,2',
|
||||
'review_remark' => 'nullable|string|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
$id = $this->route('id');
|
||||
return [
|
||||
'user_id' => 'required|integer|exists:user,id',
|
||||
'real_name' => 'required|string|max:30',
|
||||
'mobile' => 'required|string|max:20',
|
||||
'resume' => 'nullable|string|max:500',
|
||||
'id_card' => ['required', 'string', 'size:18', Rule::unique('runner_applications', 'id_card')->ignore($id)],
|
||||
'id_card_front' => 'nullable|string|max:255',
|
||||
'id_card_back' => 'nullable|string|max:255',
|
||||
'status' => 'nullable|integer|in:0,1,2',
|
||||
'review_remark' => 'nullable|string|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'real_name.required' => '真实姓名不能为空',
|
||||
'mobile.required' => '联系电话不能为空',
|
||||
'id_card.required' => '身份证号不能为空',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user