SensitiveWord.php 484 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * 敏感词 表
  4. *
  5. */
  6. namespace app\common\model;
  7. class SensitiveWord extends \think\Model
  8. {
  9. protected $pk = 'id';
  10. protected $table = 'cy_sensitive_word';
  11. // 判断敏感词是否存在
  12. public function existsWord($word,$id = 0)
  13. {
  14. if ( $id) {
  15. $condition['id'] = ['<>', $id];
  16. }
  17. $condition['word'] = $word;
  18. $count = $this->where($condition)->count();
  19. return $count ? true : false;
  20. }
  21. }