mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
初始化项目
This commit is contained in:
33
app/model/Admin.php
Normal file
33
app/model/Admin.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user