mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-29 14:01:07 +00:00
优化图片分类
This commit is contained in:
parent
4ab218cb24
commit
03f26e9257
@ -38,7 +38,11 @@ class SystemAttachmentCategory extends AuthController
|
||||
|
||||
/**
|
||||
* 显示资源列表
|
||||
* @return mixed
|
||||
* @return \think\Response
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
@ -41,14 +41,20 @@ class SystemAttachmentCategoryServices extends BaseServices
|
||||
* 获取分类列表
|
||||
* @param array $where
|
||||
* @return array
|
||||
* @throws \ReflectionException
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getAll(array $where)
|
||||
{
|
||||
$list = $this->dao->getList($where);
|
||||
foreach ($list as &$item) {
|
||||
$item['title'] = $item['name'];
|
||||
$item['children'] = [];
|
||||
if ($where['name'] == '' && $this->dao->count(['pid' => $item['id']])) $item['loading'] = false;
|
||||
if ($where['name'] == '' && $this->dao->count(['pid' => $item['id']])) {
|
||||
$item['loading'] = false;
|
||||
$item['children'] = [];
|
||||
}
|
||||
}
|
||||
return compact('list');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user