WithdrawValidate.php 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\finance\validate;
  3. use think\Validate;
  4. class WithdrawValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'customer_id' => 'require|max:100',
  8. 'trade_scene' => 'require|in:1,9',
  9. 'trade_scene_remark' => 'requireIf:trade_scene,9',
  10. 'withdraw_type' => 'require|in:1,2',
  11. 'withdraw_fee' => 'require|max:100',
  12. 'is_urgent' => 'require|in:0,1',
  13. ];
  14. protected $message = [
  15. 'customer_id.require' => '客户ID不能为空',
  16. 'trade_scene.require' => '请选择客户交易场景',
  17. 'trade_scene_remark.requireIf' => '选择【其他】场景时,交易场景备注不能为空',
  18. 'withdraw_type.require' => '请选择提现类型',
  19. 'withdraw_fee.require' => '提现手续费不能为空',
  20. 'is_urgent.require' => '请选择是否加急处理',
  21. ];
  22. protected $scene = [
  23. 'add' => ['customer_id', 'trade_scene', 'trade_scene_remark', 'withdraw_type', 'withdraw_fee', 'is_urgent'],
  24. 'edit' => ['customer_id', 'trade_scene', 'trade_scene_remark', 'withdraw_type', 'withdraw_fee', 'is_urgent'],
  25. ];
  26. }