SitemapCheck.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2021 勾股工作室
  4. * @license https://opensource.org/licenses/Apache-2.0
  5. * @link https://www.gougucms.com
  6. */
  7. namespace app\admin\validate;
  8. use think\Validate;
  9. class SitemapCheck extends Validate
  10. {
  11. protected $rule = [
  12. 'name' => 'require',
  13. 'id' => 'require',
  14. 'sitemap_cate_id' => 'require',
  15. 'pc_img' => 'require',
  16. 'pc_src' => 'require|url',
  17. 'mobile_img' => 'require',
  18. 'mobile_src' => 'require|url',
  19. ];
  20. protected $message = [
  21. 'name.require' => '名称不能为空',
  22. 'pc_img.require' => 'PC端图片不能为空',
  23. 'pc_src.require' => 'PC端链接不能为空',
  24. 'pc_src.url' => 'PC端链接必须以http开头',
  25. 'mobile_img.require' => '移动端图片不能为空',
  26. 'mobile_src.require' => '移动端链接不能为空',
  27. 'mobile_src.url' => '移动端链接必须以http开头',
  28. 'id.require' => '缺少更新条件',
  29. 'sitemap_cate_id.require' => '缺少更新条件',
  30. ];
  31. protected $scene = [
  32. 'add' => ['sitemap_cate_id', 'name', 'pc_src', 'mobile_src'],
  33. 'edit' => ['id', 'name', 'pc_src', 'mobile_src'],
  34. ];
  35. }