DistributionConfigValidate.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeshop100%开源免费商用商城系统
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | 商业版本务必购买商业授权,以免引起法律纠纷
  8. // | 禁止对系统程序代码以任何目的,任何形式的再发布
  9. // | gitee下载:https://gitee.com/likeshop_gitee
  10. // | github下载:https://github.com/likeshop-github
  11. // | 访问官网:https://www.likeshop.cn
  12. // | 访问社区:https://home.likeshop.cn
  13. // | 访问手册:http://doc.likeshop.cn
  14. // | 微信公众号:likeshop技术社区
  15. // | likeshop团队 版权所有 拥有最终解释权
  16. // +----------------------------------------------------------------------
  17. // | author: likeshopTeam
  18. // +----------------------------------------------------------------------
  19. namespace app\adminapi\validate\distribution;
  20. use app\common\validate\BaseValidate;
  21. /**
  22. * 分销配置验证器
  23. * Class DistributionConfigValidate
  24. * @package app\adminapi\validate\distribution
  25. */
  26. class DistributionConfigValidate extends BaseValidate
  27. {
  28. protected $rule = [
  29. 'switch' => 'require|in:0,1',
  30. 'level' => 'require|in:1,2',
  31. 'self' => 'require|in:0,1',
  32. 'open' => 'require|in:1,2,3',
  33. 'cal_method' => 'require|in:1',
  34. 'settlement_timing' => 'require|in:1',
  35. 'settlement_time' => 'requireWith:settlement_timing|integer',
  36. ];
  37. protected $message = [
  38. 'switch.require' => '请选择是否开启分销功能',
  39. 'switch.in' => '分销开关状态值错误',
  40. 'level.require' => '请选择分销层级',
  41. 'level.in' => '分销层级状态值错误',
  42. 'self.require' => '请选择是否开启自购返佣',
  43. 'self.in' => '自购返佣状态值错误',
  44. 'open.require' => '请选择开通分销会员条件',
  45. 'open.in' => '成为分销会员状态值错误',
  46. 'cal_method.require' => '请选择佣金计算方式',
  47. 'cal_method.in' => '佣金计算方式状态值错误',
  48. 'settlement_timing.require' => '请选择结算时机',
  49. 'settlement_timing.in' => '结算时机状态值错误',
  50. 'settlement_time.requireWith' => '请填写结算时间天数',
  51. 'settlement_time.integer' => '结算时间天数须为整数',
  52. ];
  53. }