MediaListValidate.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. 'andurl' => 'require',
  16. 'iosurl' => 'require',
  17. 'xyxurl' => 'require',
  18. 'appleturl' => 'require',
  19. 'state' => 'require',
  20. ];
  21. /**
  22. * 定义错误信息
  23. */
  24. protected $message = [
  25. 'name' => '媒体名称必须填写',
  26. 'channel_name' => '媒体渠道简称必须填写',
  27. 'andurl' => '安卓监测链接必须填写',
  28. 'iosurl' => 'ios监测链接必须填写',
  29. 'xyxurl' => '小游戏监测链接必须填写',
  30. 'appleturl' => '小游戏路径参数补充必须填写',
  31. 'state' => '状态必须填写',
  32. ];
  33. /**
  34. * 定义场景
  35. */
  36. protected $scene = [
  37. 'save' => [
  38. 'name',
  39. 'channel_name',
  40. 'andurl',
  41. 'iosurl',
  42. 'xyxurl',
  43. 'appleturl',
  44. 'state',
  45. ],
  46. 'update' => [
  47. 'name',
  48. 'channel_name',
  49. 'andurl',
  50. 'iosurl',
  51. 'xyxurl',
  52. 'appleturl',
  53. 'state',
  54. ],
  55. ];
  56. }