CinemaValidate.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\admin\validate\life;
  3. use support\Validate;
  4. class CinemaValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'cinema_id' => 'integer',
  8. 'cinema_name|名称' => 'max:255',
  9. 'cinema_img|图片' => 'url',
  10. 'cinema_video|视频' => 'url',
  11. 'cinema_price|价格' => 'float',
  12. 'cinema_seat|座位数量' => 'integer',
  13. 'cinema_join|已预订数量' => 'integer',
  14. 'cinema_length|时长' => 'integer',
  15. 'cinema_week|上映时间' => 'integer',
  16. 'cinema_time' => '',
  17. // 'cinema_label' => 'regex:/^[0-9\,]+$/',
  18. // 'cinema_mold' => 'regex:/^[0-9\,]+$/',
  19. // 'cinema_director' => 'integer',
  20. // 'cinema_star' => 'regex:/^[0-9\,]+$/',
  21. // 'cinema_introduction' => 'chsDash',
  22. // 'cinema_performers' => 'regex:/^[0-9\,]+$/',
  23. 'cinema_is_del' => 'integer',
  24. 'cinema_status' => 'integer',
  25. ];
  26. protected $message = [];
  27. protected $scene = [
  28. 'add' => ['cinema_name', 'cinema_img', 'cinema_video', 'cinema_price', 'cinema_seat', 'cinema_join', 'cinema_length', 'cinema_week', 'cinema_label', 'cinema_director', 'cinema_star', 'cinema_introduction', 'cinema_performers'],
  29. 'update' => ['cinema_name', 'cinema_img', 'cinema_video', 'cinema_price', 'cinema_seat', 'cinema_join', 'cinema_length', 'cinema_week', 'cinema_label', 'cinema_director', 'cinema_star', 'cinema_introduction', 'cinema_performers'],
  30. ];
  31. }