mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
34 lines
518 B
PHP
34 lines
518 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(60)->find();
|
|
}
|
|
|
|
}
|