tests
This commit is contained in:
@@ -63,12 +63,12 @@ class User extends Authenticatable
|
||||
return $this->hasMany('App\Models\User\UserAlt', 'character_id', 'main_id');
|
||||
}
|
||||
|
||||
public function getUserAlts() {
|
||||
return $this->hasMany('App\Models\User\UserAlt', 'character_id', 'main_id')->get();
|
||||
public function altCount() {
|
||||
return UserAlt::where(['main_id' => $this->character_id])->count();
|
||||
}
|
||||
|
||||
public function altCount() {
|
||||
return $this->hasMany('App\Models\User\UserAlt', 'character_id', 'main_id')->count();
|
||||
public function getAlts() {
|
||||
return UserAlt::where(['main_id' => $this->character_id])->get();
|
||||
}
|
||||
|
||||
public function hasPermission($permission) {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user