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.
36 lines
756 B
36 lines
756 B
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class RotationChart extends Validate
|
|
{
|
|
/**
|
|
* 定义验证规则
|
|
* 格式:'字段名' => ['规则1','规则2'...]
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $rule = [
|
|
'id|轮播图id' => 'require|number',
|
|
'title|标题' => 'require|max:40',
|
|
'image|图片地址' => 'require|max:200',
|
|
'sort|排序' => 'number',
|
|
];
|
|
|
|
/**
|
|
* 定义错误信息
|
|
* 格式:'字段名.规则名' => '错误信息'
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $message = [];
|
|
|
|
protected $scene = [
|
|
'add' => ['image','sort','title'],
|
|
'edit' => ['image','sort','title','id'],
|
|
'del' => ['id']
|
|
];
|
|
}
|
|
|