完成管理员管理

This commit is contained in:
augushong
2019-10-05 21:30:05 +08:00
parent 0db279315c
commit 79a78a889e
9 changed files with 392 additions and 36 deletions

View File

@@ -13,13 +13,21 @@ 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 [];
}
return AdminGroup::where('id',$this->getData('group_id'))->cache(1)->find();
}
}

13
app/model/User.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
namespace app\model;
use think\Model;
/**
* @mixin think\Model
*/
class User extends Model
{
//
}