2019-10-29 15:33:36 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
|
|
|
|
class PlanSave extends FormRequest
|
|
|
|
{
|
2020-02-23 02:37:52 +08:00
|
|
|
CONST RULES = [
|
|
|
|
'name' => 'required',
|
|
|
|
'content' => '',
|
|
|
|
'group_id' => 'required',
|
2020-02-27 19:36:30 +08:00
|
|
|
'type' => 'required|in:0,1',
|
2020-02-23 02:37:52 +08:00
|
|
|
'transfer_enable' => 'required',
|
|
|
|
'month_price' => 'nullable|integer',
|
|
|
|
'quarter_price' => 'nullable|integer',
|
|
|
|
'half_year_price' => 'nullable|integer',
|
2020-02-27 19:36:30 +08:00
|
|
|
'year_price' => 'nullable|integer',
|
|
|
|
'onetime_price' => 'nullable|integer'
|
2020-02-23 02:37:52 +08:00
|
|
|
];
|
2019-10-29 15:33:36 +08:00
|
|
|
/**
|
|
|
|
* Get the validation rules that apply to the request.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
2020-02-23 02:37:52 +08:00
|
|
|
return self::RULES;
|
2019-10-29 15:33:36 +08:00
|
|
|
}
|
2020-01-11 13:36:52 +08:00
|
|
|
|
2019-10-29 15:33:36 +08:00
|
|
|
public function messages()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'name.required' => '套餐名称不能为空',
|
2020-02-27 19:36:30 +08:00
|
|
|
'type.required' => '套餐类型不能为空',
|
|
|
|
'type.in' => '套餐类型格式有误',
|
2019-10-29 15:33:36 +08:00
|
|
|
'group_id.required' => '权限组不能为空',
|
2019-11-04 01:51:16 +08:00
|
|
|
'transfer_enable.required' => '流量不能为空',
|
2020-01-03 19:13:04 +08:00
|
|
|
'month_price.integer' => '月付金额格式有误',
|
|
|
|
'quarter_price.integer' => '季付金额格式有误',
|
|
|
|
'half_year_price.integer' => '半年付金额格式有误',
|
2020-02-27 19:36:30 +08:00
|
|
|
'year_price.integer' => '年付金额格式有误',
|
|
|
|
'onetime_price.integer' => '一次性金额有误'
|
2019-10-29 15:33:36 +08:00
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|