/** * 引入新的属性 */ public function attributes() { return array_merge(parent::attributes(), ['username']); }
/** * @inheritdoc */ public function attributes() { // add related fields to searchable attributes return array_merge(parent::attributes(), ['user.username', 'tag.name']); }