Adv.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 验证器
  14. */
  15. class Adv extends Validate
  16. {
  17. protected $rule = [
  18. 'ap_name'=>'require',
  19. 'ap_width'=>'require',
  20. 'ap_height'=>'require',
  21. 'adv_title'=>'require',
  22. 'ap_id'=>'require',
  23. 'adv_startdate'=>'require',
  24. 'adv_enddate'=>'require',
  25. 'adv_typedate'=>'max:255'
  26. ];
  27. protected $message = [
  28. 'ap_name.require'=>'广告位名称不能为空',
  29. 'ap_width.require'=>'广告位宽度只能为数字形式',
  30. 'ap_height.require'=>'广告位高度只能为数字形式',
  31. 'adv_title.require'=>'名称不能为空',
  32. 'ap_id.require'=>'必须选择一个广告位',
  33. 'adv_startdate.require'=>'必须选择开始时间',
  34. 'adv_enddate.require'=>'必须选择结束时间',
  35. 'adv_typedate.max'=>'操作值必须小于255个字符'
  36. ];
  37. protected $scene = [
  38. 'ap_add' => ['ap_name', 'ap_width', 'ap_height'],
  39. 'ap_edit' => ['ap_name', 'ap_width', 'ap_height'],
  40. 'adv_add' => ['adv_title', 'ap_id', 'adv_startdate', 'adv_enddate'],
  41. 'adv_edit' => ['adv_title', 'adv_startdate', 'adv_enddate'],
  42. 'app_ap_add' => ['ap_name', 'ap_width', 'ap_height'],
  43. 'app_ap_edit' => ['ap_name', 'ap_width', 'ap_height'],
  44. 'app_adv_add' => ['adv_title', 'ap_id', 'adv_startdate', 'adv_enddate','adv_typedate'],
  45. 'app_adv_edit' => ['adv_title', 'adv_startdate', 'adv_enddate','adv_typedate'],
  46. ];
  47. }