20], // [['bad_word'], 'unique'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => Yii::t('attr','bad_word.id'), 'bad_word' => Yii::t('attr','bad_word.bad_word'), 'type' => Yii::t('attr','bad_word.type'), 'replace_word' => Yii::t('attr','bad_word.replace_word'), 'create_time' => Yii::t('attr','bad_word.create_time'), 'list_order' => Yii::t('attr','bad_word.list_order'), ]; } //类型 public static function typeOptions($k=null) { $options = array('1'=>'禁止显示(全局)','2'=>'禁止显示(未登录)','3'=>'禁止显示(非会员)','4'=>'禁止搜索(全局)','5'=>'禁止搜索(未登录用户)','6'=>'禁止搜索(非会员)','88'=>'禁止发布(全局)','99'=>'全局替换'); if(is_numeric($k))return $options[$k]; return $options; } }