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.
42 lines
626 B
42 lines
626 B
<?php
|
|
declare (strict_types=1);
|
|
|
|
namespace app\api\validate;
|
|
|
|
use think\Validate;
|
|
|
|
class Message extends Validate
|
|
{
|
|
/**
|
|
* 定义验证规则
|
|
* 格式:'字段名' => ['规则1','规则2'...]
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $rule = [
|
|
'id' => 'number|length:1,10',
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 验证场景规则
|
|
* @var array
|
|
*/
|
|
protected $scene = [
|
|
'read' => ['id'],
|
|
];
|
|
|
|
/**
|
|
* 修改场景验证
|
|
* @return Manager
|
|
*/
|
|
public function sceneUpdate()
|
|
{
|
|
// return $this->remove('dict_symbol', 'dict_value')->append('');
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|