Sensitivewords.php 878 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace common\models;
  3. class Sensitivewords extends Common
  4. {
  5. public function rules()
  6. {
  7. return [
  8. ['content','string'],
  9. ['info','string'],
  10. ];
  11. }
  12. public function attributeLabels()
  13. {
  14. return [
  15. 'content'=>'广告敏感词',
  16. 'info'=>'点评敏感词',
  17. ];
  18. }
  19. public function getList()
  20. {
  21. $query = self::find();
  22. $query->orderBy(['create_at'=>SORT_DESC]);
  23. $query->asArray();
  24. return $query->one();
  25. }
  26. /*
  27. * 调用里面的验证,错误返回数组,正确返回对象
  28. * */
  29. public function Authenticator($input)
  30. {
  31. $this->load($input,'');
  32. if(!$this->validate()) return $this->errors;
  33. return $this;
  34. }
  35. public function FindById($id)
  36. {
  37. return self::findOne($id);
  38. }
  39. }