..
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user