MediaListValidate.php 996 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace app\v1\validate\advert;
  3. use think\Validate;
  4. /**
  5. * 广告媒体表验证器
  6. */
  7. class MediaListValidate extends Validate
  8. {
  9. /**
  10. * 定义验证规则
  11. */
  12. protected $rule = [
  13. 'name' => 'require',
  14. 'channel_name' => 'require',
  15. 'state' => 'require',
  16. ];
  17. /**
  18. * 定义错误信息
  19. */
  20. protected $message = [
  21. 'name' => '媒体名称必须填写',
  22. 'channel_name' => '媒体渠道简称必须填写',
  23. 'state' => '状态必须填写',
  24. ];
  25. /**
  26. * 定义场景
  27. */
  28. protected $scene = [
  29. 'save' => [
  30. 'name',
  31. 'channel_name',
  32. 'andurl',
  33. 'iosurl',
  34. 'xyxurl',
  35. 'appleturl',
  36. 'state',
  37. ],
  38. 'update' => [
  39. 'name',
  40. 'channel_name',
  41. 'andurl',
  42. 'iosurl',
  43. 'xyxurl',
  44. 'appleturl',
  45. 'state',
  46. ],
  47. ];
  48. }