税率大于0小于100
This commit is contained in:
parent
d670a46c32
commit
a01c57c025
|
|
@ -32,14 +32,20 @@ class TaxRateRequest extends FormRequest
|
|||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
$rule = [
|
||||
'name' => 'required|string|max:10',
|
||||
'rate' => 'required|numeric',
|
||||
'type' => 'required|in:percent,flat',
|
||||
'region_id' => 'required|int',
|
||||
];
|
||||
|
||||
if ($this->type == 'percent') {
|
||||
$rule['rate'] = 'required|numeric|gt:0|lt:100';
|
||||
}
|
||||
return $rule;
|
||||
}
|
||||
|
||||
|
||||
public function attributes()
|
||||
{
|
||||
return [
|
||||
|
|
|
|||
Loading…
Reference in New Issue