diff --git a/themes/beauty/controller/ListController.php b/themes/beauty/controller/ListController.php index dc188f6..2033a33 100644 --- a/themes/beauty/controller/ListController.php +++ b/themes/beauty/controller/ListController.php @@ -421,13 +421,6 @@ Class ListController extends Controller { throw new Exception("索引数据已失效,请重新扫描所有文件以生成索引数据!", 404); } - //把所有文件拼接到一个数组里 - $allFiles = []; - foreach($cacheData as $month => $files) { - $allFiles = array_merge($allFiles, $files); - } - - //其它数据获取 //优先从缓存获取目录数据 @@ -502,6 +495,23 @@ Class ListController extends Controller { } } + //按月份筛选数据 + if (!empty($para_month)) { + $newData = []; + foreach($cacheData as $month => $arr) { + if ($month != $para_month) {continue;} + $newData[$month] = $arr; + } + $cacheData = $newData; + } + + + //把所有文件拼接到一个数组里 + $allFiles = []; + foreach($cacheData as $month => $files) { + $allFiles = array_merge($allFiles, $files); + } + //dataType支持:[image, video, audio] $dataType = $this->get('dataType', 'html'); diff --git a/themes/beauty/views/list/bydate.php b/themes/beauty/views/list/bydate.php index 2f22c5d..af3b6f9 100644 --- a/themes/beauty/views/list/bydate.php +++ b/themes/beauty/views/list/bydate.php @@ -177,6 +177,27 @@ eof; echo ''; + //显示月份导航菜单 + if (!empty($viewData['para_year']) && !empty($viewData['cacheData_keys'][$viewData['para_year']])) { + echo ''; + } + + //显示图片、视频、音乐 $allFiles = $viewData['allFiles']; if(!empty($allFiles)) { //输出所有文件 @@ -325,6 +346,15 @@ if ($total > $viewData['pageSize']) { ?> +
+ +
+ \ No newline at end of file