mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
给Nav新增快捷方法
This commit is contained in:
@@ -12,18 +12,29 @@ use think\Model;
|
||||
class Nav extends Model
|
||||
{
|
||||
|
||||
protected static $listNav = [];
|
||||
|
||||
public static $statusName = [
|
||||
0=>'不显示',
|
||||
1=>'显示'
|
||||
0 => '不显示',
|
||||
1 => '显示'
|
||||
];
|
||||
//
|
||||
public function getImgAttr($value)
|
||||
{
|
||||
return get_source_link($value,'/static/images/noimg.png');
|
||||
return get_source_link($value, '/static/images/noimg.png');
|
||||
}
|
||||
|
||||
public function getStatusNameAttr()
|
||||
{
|
||||
return self::$statusName[$this->getData('status')];
|
||||
}
|
||||
|
||||
public static function getListNav($type = 1)
|
||||
{
|
||||
|
||||
if (!isset(self::$listNav[$type])) {
|
||||
self::$listNav[$type] = Nav::where('type', $type)->where('status', 1)->order('sort asc')->select();
|
||||
}
|
||||
return self::$listNav[$type];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user