OrderEffectiveLogValidate.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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\api\validate;
  15. use app\common\validate\BaseValidate;
  16. /**
  17. * OrderEffectiveLog验证器
  18. * Class OrderEffectiveLogValidate
  19. * @package app\api\validate
  20. */
  21. class OrderEffectiveLogValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'effective_id' => 'require',
  30. 'sn' => 'require',
  31. 'user_id' => 'require',
  32. 'work_id' => 'require',
  33. 'goods_id' => 'require',
  34. 'effective_num' => 'require',
  35. 'end_effective_time' => 'require',
  36. 'effective_images' => 'require'
  37. ];
  38. /**
  39. * 参数描述
  40. * @var string[]
  41. */
  42. protected $field = [
  43. 'id' => 'id',
  44. 'effective_id' => '保修卡ID',
  45. 'sn' => '订单编号',
  46. 'user_id' => '用户ID',
  47. 'work_id' => '工单ID',
  48. 'goods_id' => '商品ID',
  49. 'effective_num' => '值',
  50. 'end_effective_time' => '保修截至时间',
  51. 'effective_images' => '保修图片/视频',
  52. ];
  53. /**
  54. * @notes 添加场景
  55. * @return OrderEffectiveLogValidate
  56. * @author likeadmin
  57. * @date 2025/01/17 11:10
  58. */
  59. public function sceneAdd()
  60. {
  61. return $this->only(['effective_id','sn','user_id','work_id','goods_id','effective_num','end_effective_time']);
  62. }
  63. /**
  64. * @notes 编辑场景
  65. * @return OrderEffectiveLogValidate
  66. * @author likeadmin
  67. * @date 2025/01/17 11:10
  68. */
  69. public function sceneEdit()
  70. {
  71. return $this->only(['id','effective_id','sn','user_id','work_id','goods_id','effective_num','end_effective_time']);
  72. }
  73. /**
  74. * @notes 删除场景
  75. * @return OrderEffectiveLogValidate
  76. * @author likeadmin
  77. * @date 2025/01/17 11:10
  78. */
  79. public function sceneDelete()
  80. {
  81. return $this->only(['id']);
  82. }
  83. /**
  84. * @notes 详情场景
  85. * @return OrderEffectiveLogValidate
  86. * @author likeadmin
  87. * @date 2025/01/17 11:10
  88. */
  89. public function sceneDetail()
  90. {
  91. return $this->only(['id']);
  92. }
  93. public function sceneApplyFor()
  94. {
  95. return $this->only(['id','effective_images']);
  96. }
  97. }