Pay.php.bak 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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\api\validate;
  12. use app\common\library\ValidateExtend;
  13. class Pay extends ValidateExtend
  14. {
  15. protected $rule = [
  16. 'gameid' => 'require|positiveInteger',
  17. 'userid' => 'require|integer',
  18. 'appid' => 'require|integer',
  19. 'serverid' => 'require|max:50',
  20. 'servername' => 'require|max:255',
  21. 'amount' => 'require|integer|gt:0',
  22. 'roleid' => 'require',
  23. 'attach' => 'require',
  24. 'mc_id' => 'integer',
  25. 'channel_id' => 'require|integer',
  26. 'productname' => 'require',
  27. 'paytype' => 'require',
  28. 'imeil' => 'max:40'
  29. ];
  30. protected $message = [
  31. 'gameid.require' => '游戏id不能为空',
  32. 'gameid.positiveInteger'=> '游戏id必须为正整型',
  33. 'userid.require' => '用户ID不能为空',
  34. 'userid.integer' => '用户ID必须为整型',
  35. 'appid.require' => 'APPID不能为空',
  36. 'appid.integer' => 'APPID必须为整型',
  37. 'serverid.require' => '游戏服务器id不能为空',
  38. 'serverid.max' => '游戏服务器id不能超过50个字符',
  39. 'servername.require' => '游戏区服名称不能为空',
  40. 'servername.max' => '游戏区服名称不能超过255个字符',
  41. 'amount.require' => '充值金额不能为空',
  42. 'amount.integer' => '充值金额必须为正整型',
  43. 'amount.gt' => '充值金额必须大于0',
  44. 'roleid.require' => '角色id不能为空',
  45. 'attach.require' => '游戏合作方的订单参数不能为空',
  46. 'mc_id.integer' => '平台币劵ID必须为正整型',
  47. 'channel_id.require' => '渠道ID不能为空',
  48. 'channel_id.integer' => '渠道ID必须为整型',
  49. 'productname.require' => '消费的商品名称不能为空',
  50. 'paytype.require' => '支付类型不能为空',
  51. 'imeil.max' => '手机imei码不能超过40个字符',
  52. ];
  53. protected $scene = [
  54. 'index'=> ['gameid', 'userid', 'appid', 'serverid','amount','roleid','attach','channel_id','productname','imeil','mc_id'],
  55. 'add' => ['gameid', 'userid', 'appid', 'serverid','servername','amount','roleid','attach','channel_id','productname','paytype','imeil','mc_id'],
  56. ];
  57. }