ExportValidate.php 3.1 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\adminapi\validate\export;
  15. use app\common\validate\BaseValidate;
  16. /**
  17. * Export验证器
  18. * Class ExportValidate
  19. * @package app\adminapi\validate
  20. */
  21. class ExportValidate extends BaseValidate
  22. {
  23. /**
  24. * 设置校验规则
  25. * @var string[]
  26. */
  27. protected $rule = [
  28. 'id' => 'require',
  29. 'download_type' => 'require',
  30. 'download_fun' => 'require',
  31. 'name' => 'require',
  32. 'down_num' => 'require',
  33. 'status' => 'require',
  34. 'generate_status' => 'require',
  35. 'clear_status' => 'require',
  36. 'admin_id' => 'require',
  37. 'createtime' => 'require',
  38. 'updatetime' => 'require',
  39. ];
  40. /**
  41. * 参数描述
  42. * @var string[]
  43. */
  44. protected $field = [
  45. 'id' => 'id',
  46. 'download_type' => '下载类型:0=无,1=最后结算余额',
  47. 'download_fun' => '执行方法',
  48. 'name' => '文件名称',
  49. 'down_num' => '下载次数',
  50. 'status' => '是否过期:0=未到期,1=已到期',
  51. 'generate_status' => '生成状态:0=文件生成中,1=文件生成完成,2=文件生成失败',
  52. 'clear_status' => '清理状态:0=未清理,1=已清理',
  53. 'admin_id' => '操作人',
  54. 'createtime' => '创建时间',
  55. 'updatetime' => '修改时间',
  56. ];
  57. /**
  58. * @notes 添加场景
  59. * @return ExportValidate
  60. * @author likeadmin
  61. * @date 2024/11/18 13:31
  62. */
  63. public function sceneAdd()
  64. {
  65. return $this->only(['download_type','download_fun','name','down_num','status','generate_status','clear_status','admin_id','createtime','updatetime']);
  66. }
  67. /**
  68. * @notes 编辑场景
  69. * @return ExportValidate
  70. * @author likeadmin
  71. * @date 2024/11/18 13:31
  72. */
  73. public function sceneEdit()
  74. {
  75. return $this->only(['id','download_type','download_fun','name','down_num','status','generate_status','clear_status','admin_id','createtime','updatetime']);
  76. }
  77. /**
  78. * @notes 删除场景
  79. * @return ExportValidate
  80. * @author likeadmin
  81. * @date 2024/11/18 13:31
  82. */
  83. public function sceneDelete()
  84. {
  85. return $this->only(['id']);
  86. }
  87. /**
  88. * @notes 详情场景
  89. * @return ExportValidate
  90. * @author likeadmin
  91. * @date 2024/11/18 13:31
  92. */
  93. public function sceneDetail()
  94. {
  95. return $this->only(['id']);
  96. }
  97. }