代码功能更新

This commit is contained in:
root
2025-05-18 07:29:01 +00:00
commit 12b03531c5
2083 changed files with 695218 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
<?php
/**
* 会员管理模型
*/
namespace app\model;
use laytp\BaseModel;
use think\model\concern\SoftDelete;
class Member extends BaseModel
{
use SoftDelete;
//模型名
protected $name = 'member';
//附加属性
protected $append = ['vip_time_int','login_time_int','create_time_int','update_time_int','delete_time_int'];
//时间戳字段转换
protected $type = [
'vip_time' => 'timestamp:Y-m-d H:i:s',
];
//表名
//关联模型
public function avatarPicFile(){
return $this->belongsTo('app\model\Files','avatar_pic','id');
}
//新增属性的方法
public function getVipTimeIntAttr($value, $data)
{
return isset($data['vip_time']) ? $data['vip_time'] : 0;
}
public function getLoginTimeIntAttr($value, $data)
{
return isset($data['login_time']) ? strtotime($data['login_time']) : 0;
}
public function getCreateTimeIntAttr($value, $data)
{
return isset($data['create_time']) ? strtotime($data['create_time']) : 0;
}
public function getUpdateTimeIntAttr($value, $data)
{
return isset($data['update_time']) ? strtotime($data['update_time']) : 0;
}
public function getDeleteTimeIntAttr($value, $data)
{
return isset($data['delete_time']) ? strtotime($data['delete_time']) : 0;
}
}