Files
ulthon_admin/app/model/Admin.php
2019-10-05 21:30:05 +08:00

34 lines
517 B
PHP

<?php
namespace app\model;
use think\Model;
/**
* @mixin think\Model
*/
class Admin extends Model
{
//
public function getAvatarAttr($value)
{
if(empty($value)){
return '/static/images/avatar.jpeg';
}
return \get_source_link($value);
}
public function getGroupAttr()
{
if(empty($this->getData('group_id'))){
return [];
}
return AdminGroup::where('id',$this->getData('group_id'))->cache(1)->find();
}
}