Merge branch 'develop'
This commit is contained in:
@@ -4,21 +4,6 @@ namespace app\common\model;
|
||||
|
||||
use support\Model;
|
||||
|
||||
/**
|
||||
* systems 系统/应用表
|
||||
* @property integer $id 系统ID(主键)
|
||||
* @property string $code 系统编码(唯一英文标识)
|
||||
* @property string $name 系统名称
|
||||
* @property string $type 系统类型
|
||||
* @property string $desc 系统描述
|
||||
* @property string $icon 系统图标
|
||||
* @property string $domain_url 系统URL
|
||||
* @property string $is_role 是否区分角色权限
|
||||
* @property integer $sort 排序
|
||||
* @property integer $status 状态
|
||||
* @property integer $created_at 创建时间
|
||||
* @property integer $updated_at 更新时间
|
||||
*/
|
||||
class Systems extends Model
|
||||
{
|
||||
/**
|
||||
@@ -50,15 +35,15 @@ class Systems extends Model
|
||||
public $timestamps = true;
|
||||
|
||||
|
||||
// 系统下的资源
|
||||
public function resources()
|
||||
{
|
||||
return $this->hasMany(Resource::class, 'system_id', 'id');
|
||||
}
|
||||
protected $dateFormat = 'U';
|
||||
|
||||
// 拥有该系统访问权限的用户
|
||||
public function users()
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'user_systems', 'system_id', 'user_id');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 允许自动填充模型字段
|
||||
*/
|
||||
protected $fillable = ['id', 'code', 'name', 'type', 'desc', 'icon', 'domain_url', 'is_role', 'sort', 'status', 'created_at', 'updated_at'];
|
||||
|
||||
/**
|
||||
* 不允许自动填充模型字段
|
||||
*/
|
||||
protected $guarded = [];
|
||||
}
|
||||
Reference in New Issue
Block a user