初始化项目

This commit is contained in:
augushong
2021-06-19 13:09:45 +08:00
parent 9dff1d6115
commit ae9f2c6999
176 changed files with 23274 additions and 0 deletions

40
app/model/Nav.php Normal file
View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace app\model;
use think\Model;
/**
* @mixin think\Model
*/
class Nav extends Model
{
protected static $listNav = [];
public static $statusName = [
0 => '不显示',
1 => '显示'
];
//
public function getImgAttr($value)
{
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];
}
}