This commit is contained in:
Aether
2025-09-25 10:01:34 +08:00
parent 0ca8d067c6
commit 3c89a01a81
4 changed files with 96 additions and 2 deletions

View File

@@ -101,4 +101,16 @@ class Campus extends AetherModel
{
return $query->where('status', 1);
}
/**
* 获取校区下的老师.
* @return HasMany
*/
public function teachers(): HasMany
{
return $this->hasMany(Teacher::class, 'campus_id', 'id')
->where('status', 1)
->whereNull('deleted_at');
}
}