Files
swiftadmin/app/common/model/system/UserGroup.php

29 lines
515 B
PHP
Raw Normal View History

2022-08-19 19:48:37 +08:00
<?php
2023-04-25 20:11:49 +08:00
2022-08-19 19:48:37 +08:00
namespace app\common\model\system;
use think\Model;
use think\model\concern\SoftDelete;
2022-11-28 19:11:12 +08:00
use think\model\relation\HasMany;
2022-08-19 19:48:37 +08:00
/**
* @mixin \think\Model
*/
class UserGroup extends Model
{
use SoftDelete;
// 定义时间戳字段名
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
/**
* 关联用户组
2022-11-28 19:11:12 +08:00
* @return HasMany
2022-08-19 19:48:37 +08:00
*/
2022-11-28 19:11:12 +08:00
public function userTotal(): HasMany
2022-08-19 19:48:37 +08:00
{
return $this->hasMany(User::class,'group_id','id');
}
2022-11-28 19:11:12 +08:00
}