Files
cunkebao_v3/Server/application/common/model/DeviceUser.php

50 lines
1.0 KiB
PHP
Raw Normal View History

2025-03-27 18:08:28 +08:00
<?php
2025-03-27 18:08:28 +08:00
namespace app\common\model;
use think\Model;
/**
* 设备用户关联模型
* 用于管理设备与操盘手(用户)的关联关系
*/
class DeviceUser extends Model
{
/**
* 数据表名
* @var string
*/
2025-04-16 16:10:37 +08:00
protected $name = 'device_user';
// 自动写入时间戳
protected $autoWriteTimestamp = true;
protected $createTime = 'createTime';
protected $updateTime = 'updateTime';
2025-03-27 18:08:28 +08:00
/**
* 关联用户模型
* @return \think\model\relation\BelongsTo
*/
public function user()
{
return $this->belongsTo('User', 'userId', 'id');
}
2025-03-27 18:08:28 +08:00
/**
* 关联设备模型
* @return \think\model\relation\BelongsTo
*/
public function device()
{
return $this->belongsTo('app\common\model\Device', 'deviceId', 'id');
2025-03-27 18:08:28 +08:00
}
2025-03-27 18:08:28 +08:00
/**
* 关联公司模型
* @return \think\model\relation\BelongsTo
*/
public function company()
{
return $this->belongsTo('app\common\model\Company', 'companyId', 'id');
2025-03-27 18:08:28 +08:00
}
}