first commit
This commit is contained in:
35
芳林公司项目/www.zhiyuanhelp.com/application/admin/model/Nav.php
Normal file
35
芳林公司项目/www.zhiyuanhelp.com/application/admin/model/Nav.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 导航模型
|
||||
* */
|
||||
|
||||
namespace app\admin\model;
|
||||
|
||||
|
||||
use app\admin\service\ModelService;
|
||||
|
||||
class Nav extends ModelService {
|
||||
|
||||
/**
|
||||
* 绑定数据表
|
||||
* @var string
|
||||
*/
|
||||
protected $table = 'system_nav';
|
||||
|
||||
/**
|
||||
* 获取快捷导航
|
||||
* @param int $limit
|
||||
* @return array|\PDOStatement|string|\think\Collection
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public static function getQuickNav($limit = 6) {
|
||||
$list = self::where(['status' => 1])->order(['sort' => 'desc', 'create_at' => 'desc'])
|
||||
->limit($limit)->select()->each(function ($item, $key) {
|
||||
$item['href'] = url($item['href']);
|
||||
});
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user