You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shipin/app/adminapi/validate/ipc/IpcValidate.php

40 lines
1.0 KiB

10 months ago
<?php
namespace app\adminapi\validate\ipc;
use think\Validate;
class IpcValidate extends Validate
{
/**
* 定义验证规则
* @var array
*/
protected $rule = [
'start_day' => 'require|In:0,1,2,3,4,5,6',
'end_day' => 'require|In:0,1,2,3,4,5,6',
'start_time' => 'require|number|gt:-1|lt:24',
'end_time' => 'require|number|gt:-1|lt:24',
];
/**
* 定义错误信息
* @var array
*/
protected $message = [
'start_day.In' => '开始天数输入的范围为0-6',
'end_day.In' => '结束天数输入的范围为0-6',
'start_time.number' => '开始时间请输入整数',
'end_time.number' => '结束时间请输入整数',
'start_time.gt' => '开始时间需大于等于0时',
'start_time.lt' => '开始时间需小于等于23时',
'end_time.gt' => '结束时间需大于等于0时',
'end_time.lt' => '结束时间需小于等于23时',
];
protected $scene = [
'save' => [],
];
}