This commit is contained in:
2021-05-24 22:20:09 +09:00
parent 1052c6241e
commit 7a46e8684f
2 changed files with 6 additions and 2 deletions

View File

@@ -45,9 +45,9 @@ class TestController extends Controller
//Get a list of the alts for each character, then process the ledgers and combine them to send one mail out
//in this first part
foreach($users as $char) {
$altCount = $char->altCount();
$altCount = $char->altCount;
if($altCount > 0) {
$alts = $char->userAlts();
$alts = $char->userAlts;
foreach($alts as $alt) {
$perms->push([

View File

@@ -63,6 +63,10 @@ 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 $this->hasMany('App\Models\User\UserAlt', 'character_id', 'main_id')->count();
}