KeywordsCheck.php 673 B

12345678910111213141516171819202122232425262728293031
  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\facade\Db;
  9. use think\Validate;
  10. class KeywordsCheck extends Validate
  11. {
  12. protected $rule = [
  13. 'title' => 'require|unique:keywords',
  14. 'id' => 'require',
  15. ];
  16. protected $message = [
  17. 'title.require' => '关键字名称不能为空',
  18. 'title.unique' => '同样的关键字名称已经存在',
  19. 'id.require' => '缺少更新条件',
  20. ];
  21. protected $scene = [
  22. 'add' => ['title'],
  23. 'edit' => ['id', 'title'],
  24. ];
  25. }