UserQuotationRequest.php
1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace App\Http\Container\AppSection\Requests;
use Hikoon\LaravelApi\Support\ApiRequest;
class UserQuotationRequest extends ApiRequest
{
/**
* @return string[]
*/
public function rules(): array
{
return [
'is_reward' => 'required|in:0,1',
'reward_price' => 'required_if:is_reward,1|numeric|between:0,99999999',
'is_dividend' => 'required|in:0,1',
'dividend_year' => 'required_if:is_dividend,1|string',
'dividend_ratio' => 'required_if:is_dividend,1|numeric|between:0,100',
'is_talk' => 'required|in:0,1',
'is_public' => 'required|in:0,1',
];
}
/**
* @return array
*/
public function messages(): array
{
return [
'is_reward.*' => '请选择是否同意唱酬',
'is_dividend.*' => '请选择是否同意分成',
'is_talk.*' => '请选择是否可谈',
'is_public.*' => '请选择是否公开',
'reward_price.required_if' => '请输入唱酬金额',
'reward_price.numeric' => '唱酬金额类型错误',
'reward_price.between' => '唱酬金额区间:min~:max',
'dividend_year.required_if' => '请选择分成年限',
'dividend_ratio.required_if' => '请输入分成比例',
'dividend_ratio.numeric' => '分成比例类型错误',
'dividend_ratio.between' => '分成比例区间:min~:max'
];
}
}