HomeSpecialValidate.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace app\api\validate;
  3. use app\common\validate\BaseValidate;
  4. /**
  5. * HomeSpecial验证器
  6. * Class HomeSpecialValidate
  7. * @package app\api\validate\home_service
  8. */
  9. class HomeSpecialValidate extends BaseValidate
  10. {
  11. /**
  12. * 设置校验规则
  13. * @var string[]
  14. */
  15. protected $rule = [
  16. 'id' => 'require',
  17. 'special_type' => 'require',
  18. 'title' => 'require',
  19. 'cover_type' => 'require',
  20. 'cover' => 'require',
  21. 'vue_web' => 'require',
  22. 'vue_param' => 'require',
  23. 'weight' => 'require',
  24. 'view_num' => 'require',
  25. 'status' => 'require',
  26. ];
  27. /**
  28. * 参数描述
  29. * @var string[]
  30. */
  31. protected $field = [
  32. 'id' => 'id',
  33. 'special_type' => '专题页类别',
  34. 'title' => '专题页名称',
  35. 'cover_type' => '封面类型:0=图片,1=视频',
  36. 'cover' => '封面',
  37. 'vue_web' => '专题页地址',
  38. 'vue_param' => '专题页参数',
  39. 'weight' => '权重',
  40. 'view_num' => '浏览次数',
  41. 'status' => '状态',
  42. ];
  43. /**
  44. * @notes 详情场景
  45. * @return HomeSpecialValidate
  46. * @author likeadmin
  47. * @date 2024/11/18 10:05
  48. */
  49. public function sceneDetail()
  50. {
  51. return $this->only(['id']);
  52. }
  53. }