1
0
Files
helper/application/common/validate/ScoreRules.php
2020-08-06 14:58:51 +08:00

50 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\common\validate;
use think\Validate;
class ScoreRules extends Validate
{
/**
* 验证规则
* @var array
*/
protected $rule = [
'title' => 'require|length:2,100',
'score' => 'require|number',
'times' => 'require|number',
'model' => 'require',
];
/**
* 提示信息
* @var array
*/
protected $message = [
'title.require' => '名称必须填写',
'title.length' => '名称长度应在:1-:2位之间',
'score.require' => '积分必须填写',
'score.number' => '积分必须是数字',
'times.require' => '每日次数必须填写',
'times.require' => '每日次数必须是数字',
'model.require' => '规则名必须填写',
];
/**
* 验证场景
* @var array
*/
protected $scene = [
'add' => ['title', 'score', 'times', 'model'],
];
}