Files
tuiguangzhushou/application/common/model/MemberSet.php
2020-08-06 15:26:41 +08:00

55 lines
1.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\common\model;
use think\Config;
class MemberSet extends _Init
{
/**
* 关闭更新时间写入
*/
protected $updateTime = false;
/**
* 模型初始化【事件注册】
*/
protected static function init()
{
self::beforeInsert(function ($data) {
});
}
public function getTypeTextAttr($value, $data)
{
switch ($data['type']) {
case 'vip':
return Config::get('role_type.vip');
break;
case 'agent':
return Config::get('role_type.agent');
break;
default:
return "未知";
break;
}
}
protected function user()
{
return $this->hasOne('Member', 'id', 'uid');
}
public function operation()
{
return $this->hasOne('Member', 'id', 'operator');
}
}