HomeBannerValidate.php 737 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\admin\validate\home;
  3. use think\Validate;
  4. class HomeBannerValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'banner_name' => 'require|max:100',
  8. 'banner_id' => 'require',
  9. 'banner_category_id' => 'require',
  10. 'banner_img' => 'require',
  11. ];
  12. protected $message = [
  13. 'banner_name' => 'banner名不能为空',
  14. 'banner_id' => 'banner_id不能为空',
  15. 'banner_category_id' => '分类不能为空',
  16. 'banner_img' => 'banner图不能为空',
  17. ];
  18. //场景
  19. protected $scene = [
  20. 'create' => ['banner_name','banner_category_id','banner_img'],
  21. 'update' => ['banner_id'],
  22. 'info' => ['banner_id']
  23. ];
  24. }