Dopay.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2017 https://www.sapixx.com All rights reserved.
  4. * @license Licensed (http://www.apache.org/licenses/LICENSE-2.0).
  5. * @author pillar<ltmn@qq.com>
  6. * 付款验证
  7. */
  8. namespace app\allwin\validate;
  9. use think\Validate;
  10. class Dopay extends Validate{
  11. protected $rule = [
  12. 'member_miniapp_id' => 'require|number',
  13. 'store_id' => 'require|number',
  14. 'user_couponr_id' => 'integer',
  15. 'coupon_id' => 'require|integer',
  16. 'coupon_ids' => 'array',
  17. 'money' => 'require|float|>:0',
  18. 'amount' => 'require|float',
  19. 'telphone' => 'require|mobile',
  20. ];
  21. protected $message = [
  22. 'member_miniapp_id' => '应用验证失败',
  23. 'store_id' => '店铺不存在',
  24. 'user_couponr_id' => '优惠券不存在',
  25. 'coupon_id' => '请选择可用优惠券',
  26. 'coupon_ids' => '请选择可领优惠券',
  27. 'money' => '请输入付款金额',
  28. 'amount' => '请输入支付金额',
  29. 'telphone' => '请输入正确的手机号',
  30. ];
  31. protected $scene = [
  32. 'gopay' => ['member_miniapp_id', 'store_id', 'user_couponr_id', 'money', 'amount'],
  33. 'coupon' => ['member_miniapp_id', 'coupon_id'],
  34. 'goods' => ['shop_id','telphone'],
  35. 'ecard' => ['member_miniapp_id','card_id','uid'],
  36. 'agent' => ['member_miniapp_id','uid'],
  37. ];
  38. }