You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
729 B
31 lines
729 B
<?php
|
|
declare (strict_types=1);
|
|
|
|
namespace app\api\model;
|
|
|
|
/**
|
|
* @mixin think\Model
|
|
*/
|
|
class Site extends Common
|
|
{
|
|
|
|
/**
|
|
* 根据域名读取站点信息
|
|
* @return array|\think\Model|null
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
*/
|
|
public function checkSite()
|
|
{
|
|
$_op = $this->whereFindInSet('host', $this->request->host());
|
|
$_op->where('start_time', '<=', time());
|
|
$_op->where('end_time', '>=', time());
|
|
$_data = $_op->find();
|
|
if (empty($_data)) {
|
|
return send_http_status('', 102);
|
|
}
|
|
return $_data->id;
|
|
}
|
|
|
|
}
|
|
|