12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace common\models;
- class Sensitivewords extends Common
- {
- public function rules()
- {
- return [
- ['content','string'],
- ['info','string'],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'content'=>'广告敏感词',
- 'info'=>'点评敏感词',
- ];
- }
- public function getList()
- {
- $query = self::find();
- $query->orderBy(['create_at'=>SORT_DESC]);
- $query->asArray();
- return $query->one();
- }
- /*
- * 调用里面的验证,错误返回数组,正确返回对象
- * */
- public function Authenticator($input)
- {
- $this->load($input,'');
- if(!$this->validate()) return $this->errors;
- return $this;
- }
- public function FindById($id)
- {
- return self::findOne($id);
- }
- }
|