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.

21 lines
766 B

7 years ago
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class Payment extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. ['id', 'require|number','ID必填|ID必须是数字'],
  9. ['pay_code', 'require|max:20','支付方式的英文缩写必填|支付方式的英文缩写不能超过20个字符'],
  10. ['pay_name', 'require|max:100','支付方式名称必填|支付方式名称不能超过100个字符'],
  11. ['pay_fee', 'max:10','支付费用不能超过10个字符'],
  12. ['status', 'in:0,1', '是否可用;0否;1是'],
  13. ['listorder', 'number','排序必须是数字'],
  14. ];
  15. protected $scene = [
  16. 'add' => ['pay_code', 'pay_name', 'pay_fee', 'status', 'listorder'],
  17. 'del' => ['id'],
  18. ];
  19. }