This commit is contained in:
2021-05-24 23:11:29 +09:00
parent 58258a070e
commit af7c7344b4
3 changed files with 12 additions and 8 deletions

View File

@@ -32,6 +32,10 @@ class UserAlt extends Model
];
public function mainCharacter() {
return $this->belongsTo('App\Models\User\User', 'character_id');
return $this->belongsTo('App\Models\User\User', 'character_id', 'main_id');
}
public function getMain() {
return User::where(['character_id' => $this->main_id])->get();
}
}