|
@@ -111,7 +111,23 @@
|
|
|
@if ($tab['column'] == 'video' && empty($content) == false)
|
|
|
<?php
|
|
|
//$content倒序
|
|
|
- $content = array_reverse($content);
|
|
|
+ array_walk($content, function(&$item, $index) {
|
|
|
+ $item['__index'] = $index;
|
|
|
+ });
|
|
|
+ usort($content, function($a, $b) {
|
|
|
+ // order > 0 的元素组内排序(倒序)
|
|
|
+ if ($a['order'] > 0 && $b['order'] > 0) {
|
|
|
+ return $b['order'] <=> $a['order'];
|
|
|
+ }
|
|
|
+ // order = 0 的元素组内排序(按原始索引倒序)
|
|
|
+ elseif ($a['order'] == 0 && $b['order'] == 0) {
|
|
|
+ return $b['__index'] <=> $a['__index']; // 注意这里用b比a
|
|
|
+ }
|
|
|
+ // 不同组间的排序(order>0的总是排在最前)
|
|
|
+ else {
|
|
|
+ return ($a['order'] > 0) ? -1 : 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
?>
|
|
|
<table class="album_table">
|
|
|
<thead>
|