Files
mayi-grade/application/system/model/School.php
T
2018-10-28 22:37:37 +08:00

37 lines
631 B
PHP

<?php
namespace app\system\model;
use app\common\model\Base;
class School extends Base
{
// 单位性质获取器
public function getXingzhiAttr($value)
{
return $this->getcategory($value);
}
// 单位级别获取器
public function getJibieAttr($value)
{
return $this->getcategory($value);
}
// 单位学段获取器
public function getXueduanAttr($value)
{
return $this->getcategory($value);
}
// 获取类别名
public function getcategory($id)
{
return db('category')
->where('id',$id)
->value('title');
}
}