add_skill_column_inuser_index
This commit is contained in:
@ -5,6 +5,7 @@ namespace common\models;
|
||||
use Yii;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\Expression;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
/**
|
||||
* This is the model class for table "user_card".
|
||||
@ -140,4 +141,14 @@ class UserCard extends \yii\db\ActiveRecord
|
||||
{
|
||||
return $this->genders[$this->gender];
|
||||
}
|
||||
|
||||
public function getSkillValues()
|
||||
{
|
||||
return $this->hasMany(CardSkill::class, ['card_id' => 'id'])->with('skill');
|
||||
}
|
||||
|
||||
public static function getNameSkills()
|
||||
{
|
||||
return ArrayHelper::map(Skill::find()->all(),'id', 'name');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user