PerformanceRulesValidate.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\validate\performance;
  15. use app\common\validate\BaseValidate;
  16. /**
  17. * PerformanceRules验证器
  18. * Class PerformanceRulesValidate
  19. * @package app\adminapi\validate\performance
  20. */
  21. class PerformanceRulesValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'goods_category_ids' => 'require',
  30. 'type' => 'require',
  31. 'rate' => 'require',
  32. ];
  33. /**
  34. * 参数描述
  35. * @var string[]
  36. */
  37. protected $field = [
  38. 'id' => 'id',
  39. 'goods_category_ids' => '分类集合',
  40. 'type' => '结算方式',
  41. 'rate' => '提成比例',
  42. ];
  43. /**
  44. * @notes 添加场景
  45. * @return PerformanceRulesValidate
  46. * @author likeadmin
  47. * @date 2024/07/15 17:52
  48. */
  49. public function sceneAdd()
  50. {
  51. return $this->only(['goods_category_ids','type','rate']);
  52. }
  53. /**
  54. * @notes 编辑场景
  55. * @return PerformanceRulesValidate
  56. * @author likeadmin
  57. * @date 2024/07/15 17:52
  58. */
  59. public function sceneEdit()
  60. {
  61. return $this->only(['id','goods_category_ids','type','rate']);
  62. }
  63. /**
  64. * @notes 删除场景
  65. * @return PerformanceRulesValidate
  66. * @author likeadmin
  67. * @date 2024/07/15 17:52
  68. */
  69. public function sceneDelete()
  70. {
  71. return $this->only(['id']);
  72. }
  73. /**
  74. * @notes 详情场景
  75. * @return PerformanceRulesValidate
  76. * @author likeadmin
  77. * @date 2024/07/15 17:52
  78. */
  79. public function sceneDetail()
  80. {
  81. return $this->only(['id']);
  82. }
  83. }