| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace App\Http\Requests\Procurement;
- use App\Traits\RequestApiFormValidation;
- use Illuminate\Foundation\Http\FormRequest;
- class ProcurementAmountRequest extends FormRequest
- {
- use RequestApiFormValidation;
- /**
- * Determine if the user is authorized to make this request.
- *
- * @return bool
- */
- public function authorize()
- {
- return true;
- }
- /**
- * Get the validation rules that apply to the request.
- *
- * @return array
- */
- public function rules()
- {
- return [
- 'quantity'=>'required|numeric|min:0|not_in:0',
- 'amount'=>'required|numeric|min:0|not_in:0',
- ];
- }
- public function messages()
- {
- return [
- 'quantity.required' => '采购数量不可为空',
- 'quantity.not_in' => '采购数量不可为0',
- 'amount.required' => '销售数量不可为空',
- 'amount.not_in' => '销售数量不可为0',
- ];
- }
- }
|