123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\common\validate\pay;
- use think\Validate;
- class Config extends Validate
- {
- /**
- * 验证规则
- */
- protected $rule = [
- 'name' => 'require|max:50',
- 'type' => 'require|in:wechat,alipay,douyin',
- 'status' => 'require|in:0,1',
- 'params' => 'array'
- ];
-
- /**
- * 提示消息
- */
- protected $message = [
- 'name.require' => '配置名称不能为空',
- 'name.max' => '配置名称不能超过50个字符',
- 'type.require' => '支付类型不能为空',
- 'type.in' => '支付类型不正确',
- 'status.require' => '状态不能为空',
- 'status.in' => '状态值不正确',
- 'params.array' => '参数必须为数组格式'
- ];
-
- /**
- * 验证场景
- */
- protected $scene = [
- 'add' => ['name', 'type', 'status', 'params'],
- 'edit' => ['name', 'type', 'status', 'params'],
- ];
- }
|