初始化代码
This commit is contained in:
46
application/admin/model/UserRelation.php
Normal file
46
application/admin/model/UserRelation.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
class UserRelation extends Model
|
||||
{
|
||||
protected $pk = 'rid';
|
||||
protected $auto = ['update_time'];
|
||||
protected $insert = [
|
||||
'add_time',
|
||||
'status' => 1,
|
||||
'deal_time' => 0,
|
||||
|
||||
];
|
||||
protected $update = ['update_time'];
|
||||
|
||||
protected function setAddTimeAttr()
|
||||
{
|
||||
return time();
|
||||
}
|
||||
|
||||
protected function setUpdateTimeAttr()
|
||||
{
|
||||
return time();
|
||||
}
|
||||
public static function TypeLable()
|
||||
{
|
||||
return [
|
||||
'1' => '情侣',
|
||||
'2' => '师徒',
|
||||
'3' => '守护',
|
||||
];
|
||||
}
|
||||
|
||||
public function get_relation_type_lable($type)
|
||||
{
|
||||
$data = $this->TypeLable();
|
||||
if (empty($data[$type])) {
|
||||
return '';
|
||||
} else {
|
||||
return $data[$type];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user