ChannelRecharge.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2013-2017 http://www.thinkcmf.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 小夏 < 449134904@qq.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\mcpsapi\validate;
  12. use app\common\library\ValidateExtend;
  13. class ChannelRecharge extends ValidateExtend
  14. {
  15. protected $rule = [
  16. 'recharge_type' => 'require|positiveInteger',
  17. 'amount' => 'require|integer|gt:0',
  18. 'real_amount' => 'require|number|gt:0',
  19. ];
  20. protected $message = [
  21. 'recharge_type.require' => '充值方式不能为空',
  22. 'recharge_type.positiveInteger' => '充值方式必须为正整型',
  23. 'amount.require' => '充值金额不能为空',
  24. 'amount.integer' => '充值金额必须为正整型',
  25. 'amount.gt' => '充值金额必须大于0',
  26. 'real_amount.require' => '支付金额不能为空',
  27. 'real_amount.number' => '支付金额必须为数值类型',
  28. 'real_amount.gt' => '支付金额必须大于0',
  29. ];
  30. protected $scene = [
  31. 'add'=> ['recharge_type', 'amount', 'real_amount'],
  32. ];
  33. }