初始化项目

This commit is contained in:
augushong
2020-08-07 23:49:50 +08:00
parent 30d8c3b64b
commit 3bc46a4b9c
304 changed files with 29675 additions and 0 deletions

33
app/model/Admin.php Normal file
View 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();
}
}