..
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');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,8 @@ class CampusValidator extends AetherValidator
|
||||
'province' => 'nullable|string|max:100',
|
||||
'city' => 'nullable|string|max:100',
|
||||
'status' => 'nullable|integer|in:0,1',
|
||||
'page' => 'nullable|integer|min:1',
|
||||
'size' => 'nullable|integer|min:1|max:100',
|
||||
],
|
||||
'messages' => [
|
||||
'level.in' => '层级只能是1、2、3',
|
||||
|
||||
Reference in New Issue
Block a user