DomainInfo.php
2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
namespace App\Models\Domain;
use App\Helper\Arr;
use App\Models\Base;
/**
* Class DomainInfo
*
* @package App\Models\Aside\DomainLogic
* @Author YiYuan-LIn
* @Date : 2019/5/16
* 域名信息模型
*/
class DomainInfo extends Base
{
const STATUS_ONE = 1;
const STATUS_ZERO = 0;
public $btAction = [
'create_site' => '/site?action=AddSite',
];
protected $table = 'gl_domain_info';
// 软删除 0:正常 1:删除
/** @var int 软删除 - 正常 */
const DELETED_NORMAL = 0;
/** @var int 软删除 - 删除 */
const DELETED_DELETE = 1;
protected $hidden = [
'created_at',
'updated_at'
];
/**
* 字段信息
* @return array
*/
public function FieldsArray()
{
return [
'domain' => '域名',
'belong_to' => '域名归属',
'status' => '域名状态',
'domain_start_time' => '域名开始时间',
'domain_end_time' => '域名结束时间',
'certificate_start_time' => '证书开始时间',
'certificate_end_time' => '证书结束时间',
];
}
/**
* @remark :获取域名信息
* @name :getDomain
* @author :lyh
* @method :post
* @time :2023/9/4 17:05
*/
public function getDomain($domain){
$info = $this->read(['id'=>$domain]);
if($info === false){
return '';
}
return 'https://'.$info['domain'].'/';
}
/**
* @remark :301跳转扩展字段
* @name :getExtendConfigAttribute
* @author :lyh
* @method :post
* @time :2023/11/6 15:36
*/
public function getExtendConfigAttribute($value)
{
$value = Arr::s2a($value);
return $value;
}
/**
* @remark :域名列表设置
* @name :getOtherDomainAttribute
* @author :lyh
* @method :post
* @time :2023/11/6 15:39
*/
public function getOtherDomainAttribute($value)
{
$value = Arr::s2a($value);
return $value;
}
}