first commit
This commit is contained in:
27
app/Models/Auth/Department.php
Normal file
27
app/Models/Auth/Department.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2024 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace App\Models\Auth;
|
||||
|
||||
class Department extends \App\Models\BaseModel {
|
||||
|
||||
protected $table = 'auth_departments';
|
||||
protected $fillable = ['title', 'name', 'parent_id', 'status', 'sort'];
|
||||
protected $hidden = ['deleted_at'];
|
||||
|
||||
protected function casts(): array {
|
||||
return [
|
||||
'parent_id' => 'integer',
|
||||
'sort' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
public function members(){
|
||||
return $this->hasMany(Admin::class, 'department_id', 'uid');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user