CollegeCoursesValidate.php 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\admin\validate\life;
  3. use support\Validate;
  4. class CollegeCoursesValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'courses_id' => 'require|integer',
  8. 'courses_name|名称' => 'require',
  9. 'courses_img|图片' => 'url',
  10. 'courses_introduction|简介' => 'require',
  11. 'courses_type|类型' => 'integer',
  12. // 'courses_time' => '',
  13. // 'courses_long'=>'',
  14. // 'courses_week' => 'integer',
  15. 'courses_category_id|关联分类' => 'require|integer',
  16. 'courses_teacher_id|关联老师' => 'require|integer',
  17. 'courses_num|上课人数' => 'require|integer',
  18. 'courses_join_num|参与人数' => 'integer',
  19. // 'courses_label' => 'chsDash',
  20. 'courses_status|状态' => 'integer',
  21. 'courses_is_del' => 'integer'
  22. ];
  23. protected $message = [];
  24. protected $scene = [
  25. 'add' => ['courses_name', 'courses_img', 'courses_introduction', 'courses_type', 'courses_time', 'courses_week', 'courses_category_id', 'courses_teacher_id', 'courses_num', 'courses_join_num', 'courses_label', 'courses_status', 'courses_is_del'],
  26. 'update' => ['courses_id', 'courses_name', 'courses_img', 'courses_introduction', 'courses_type', 'courses_time', 'courses_week', 'courses_category_id', 'courses_teacher_id', 'courses_num', 'courses_join_num', 'courses_label', 'courses_status', 'courses_is_del']
  27. ];
  28. }