FourActivityValidate.php 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <?php
  2. namespace App\Validate;
  3. use App\Models\FourActivity;
  4. use App\Validate\BaseValidate;
  5. /**
  6. * 文章验证器
  7. */
  8. class FourActivityValidate extends BaseValidate {
  9. //验证规则
  10. protected $rule =[
  11. 'activities_type'=>'required',
  12. 'active_time' => 'required',
  13. 'place' => 'required',
  14. 'audience_crowd' => 'required',
  15. 'title' => 'required',
  16. 'anchor' => 'required',
  17. 'educational_materials' => 'required',
  18. 'publicity_board' => 'required',
  19. 'member_num' => 'required',
  20. 'planned_number' => 'required',
  21. 'actual_number' => 'required',
  22. 'filling_people' => 'required',
  23. 'filling_time' => 'required',
  24. 'mode' => 'required',
  25. 'declaration_form' => 'required',
  26. 'task_book' => 'required',
  27. 'final_report' => 'required',
  28. 'return_receipt' => 'required',
  29. 'ext' => 'required',
  30. ];
  31. //自定义验证信息
  32. protected $message = [
  33. 'title.required'=>'标题不能为空',
  34. 'activities_type.required'=>'四进类型不能为空',
  35. 'active_time.required'=>'活动时间不能为空',
  36. 'place.required'=>'活动地点不能为空',
  37. 'audience_crowd.required'=>'受众人群不能为空',
  38. 'anchor.required'=>'讲者/主持不能为空',
  39. 'educational_materials.required'=>'发放宣教材料不能为空',
  40. 'publicity_board.required'=>'宣传栏不能为空',
  41. 'member_num.required'=>'受宣人次数不能为空',
  42. 'planned_number.required'=>'计划人数不能为空',
  43. 'actual_number.required'=>'实到人数不能为空',
  44. 'filling_people.required'=>'填表人不能为空',
  45. 'filling_time.required'=>'填表时间不能为空',
  46. 'mode.required'=>'方式不能为空',
  47. 'declaration_form.required'=>'申报书不能为空',
  48. 'task_book.required'=>'任务书不能为空',
  49. 'final_report.required'=>'结题报告书不能为空',
  50. 'return_receipt.required'=>'回执单不能为空',
  51. ];
  52. //自定义场景
  53. protected $scene = [
  54. FourActivity::TYPE_SCIENCE_POPULARIZATION_BASE =>[
  55. 'title',
  56. 'activities_type',
  57. 'active_time','place',
  58. 'audience_crowd',
  59. 'anchor',
  60. 'educational_materials',
  61. 'publicity_board',
  62. 'member_num',
  63. 'planned_number',
  64. 'actual_number',
  65. 'filling_people',
  66. 'filling_time',
  67. 'mode',
  68. ],
  69. FourActivity::TYPE_PROMOTION_ACTIVITIES => [
  70. 'title',
  71. 'activities_type',
  72. 'active_time','place',
  73. 'audience_crowd',
  74. 'anchor',
  75. 'educational_materials',
  76. 'publicity_board',
  77. 'member_num',
  78. 'planned_number',
  79. 'actual_number',
  80. 'filling_people',
  81. 'filling_time',
  82. 'mode',
  83. ],
  84. FourActivity::TYPE_FEATURED_SERVICES => [
  85. 'title',
  86. 'declaration_form',
  87. 'task_book',
  88. 'final_report',
  89. ],
  90. FourActivity::TYPE_FEATURED_REPORT_RECEIPT => [
  91. 'title',
  92. 'return_receipt',
  93. ],
  94. ];
  95. }