BuildingEnterLog.php
1.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
<?php
namespace app\index\model;
use think\Model;
class BuildingEnterLog extends Model
{
const APPLY = 1;
const AGREE = 2;
const REJECT = 3;
CONST EXPIRE = 4;
protected $table = 'fa_building_enter_log';
protected $autoWriteTimestamp = 'int';
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
];
/**
* 获取器:创建时间
* @param $value
* @return false|string
*/
public function getCreateTimeAttr($value)
{
return $value > 0 ? date('Y-m-d H:i:s', $value) : 0;
}
/**
* 获取器:创建时间
* @param $value
* @return false|string
*/
public function getLogTypeAttr($value)
{
if($value == self::APPLY) {
return '入驻申请已提交';
} else if($value == self::AGREE) {
return '入驻申请已同意';
}else if($value == self::REJECT){
return '入驻申请已驳回';
}else{
return '入驻已到期';
}
}
}