77 lines
1.9 KiB
PHP
77 lines
1.9 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||
// +----------------------------------------------------------------------
|
||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||
// | 开源版本可自由商用,可去除界面版权logo
|
||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||
// | 访问官网:https://www.likeadmin.cn
|
||
// | likeadmin团队 版权所有 拥有最终解释权
|
||
// +----------------------------------------------------------------------
|
||
// | author: likeadminTeam
|
||
// +----------------------------------------------------------------------
|
||
|
||
namespace app\common\model\device;
|
||
|
||
|
||
use app\common\model\BaseModel;
|
||
|
||
|
||
|
||
/**
|
||
* AirMonitor模型
|
||
* Class AirMonitor
|
||
* @package app\common\model\device
|
||
*/
|
||
class AirMonitor extends BaseModel
|
||
{
|
||
|
||
protected $name = 'air_monitor';
|
||
|
||
|
||
|
||
/**
|
||
* @notes 关联device
|
||
* @return \think\model\relation\HasOne
|
||
* @author likeadmin
|
||
* @date 2023/11/24 16:49
|
||
*/
|
||
public function device()
|
||
{
|
||
return $this->hasOne(\app\common\model\device\Device::class, 'id', 'device_id');
|
||
}
|
||
|
||
/**
|
||
* @notes 搜索器-注册时间
|
||
* @param $query
|
||
* @param $value
|
||
* @param $data
|
||
* @author 段誉
|
||
* @date 2022/9/22 16:13
|
||
*/
|
||
public function searchStartTimeAttr($query, $value, $data)
|
||
{
|
||
if ($value) {
|
||
$query->where('create_time', '>=', strtotime($value));
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @notes 搜索器-注册时间
|
||
* @param $query
|
||
* @param $value
|
||
* @param $data
|
||
* @author 段誉
|
||
* @date 2022/9/22 16:13
|
||
*/
|
||
public function searchEndTimeAttr($query, $value, $data)
|
||
{
|
||
if ($value) {
|
||
$query->where('create_time', '<=', strtotime($value));
|
||
}
|
||
}
|
||
|
||
|
||
|
||
} |