Browse Source

bug fix for no data

master
filesite 4 months ago
parent
commit
1e17661767
  1. 6
      themes/beauty/controller/ListController.php

6
themes/beauty/controller/ListController.php

@ -100,7 +100,7 @@ Class ListController extends Controller { @@ -100,7 +100,7 @@ Class ListController extends Controller {
//获取目录面包屑
$subcate = $scanResults[$cateId];
$subcate = !empty($scanResults[$cateId]) ? $scanResults[$cateId] : array();
$breadcrumbs = $this->getBreadcrumbs($currentDir, $cachedParentData, $scanner);
//图片、视频类型筛选支持
@ -152,7 +152,7 @@ Class ListController extends Controller { @@ -152,7 +152,7 @@ Class ListController extends Controller {
//dataType支持:[image, video]
$dataType = $this->get('dataType', 'html');
if ($dataType == 'image') {
if ($dataType == 'image' && !empty($subcate['files'])) {
$imgExts = !empty(FSC::$app['config']['supportedImageExts']) ? FSC::$app['config']['supportedImageExts'] : array('jpg', 'jpeg', 'png', 'webp', 'gif');
$imgs = array();
$pageStartIndex = ($page-1) * $pageSize;
@ -172,7 +172,7 @@ Class ListController extends Controller { @@ -172,7 +172,7 @@ Class ListController extends Controller {
}
}
return $this->renderJson(compact('page', 'pageSize', 'imgs'));
}else if ($dataType == 'video') {
}else if ($dataType == 'video' && !empty($subcate['files'])) {
$videoExts = !empty(FSC::$app['config']['supportedVideoExts']) ? FSC::$app['config']['supportedVideoExts'] : array('mp4', 'mov', 'm3u8');
$videos = array();
$pageStartIndex = ($page-1) * $pageSize;

Loading…
Cancel
Save