|
@@ -348,6 +348,7 @@ JS
|
|
$imgArray = "";
|
|
$imgArray = "";
|
|
if ($videos) {
|
|
if ($videos) {
|
|
$videos = json_decode($videos,true);
|
|
$videos = json_decode($videos,true);
|
|
|
|
+ $videos = CommonHelper::orderByAlbumVideo($videos);
|
|
foreach ($videos as $key => $value) {
|
|
foreach ($videos as $key => $value) {
|
|
if ($value['cover'] && $key == $count-1) {
|
|
if ($value['cover'] && $key == $count-1) {
|
|
$imgArray = [$value['cover']];
|
|
$imgArray = [$value['cover']];
|
|
@@ -381,17 +382,7 @@ JS
|
|
})->useTable()
|
|
})->useTable()
|
|
->customFormat(function ($data) {
|
|
->customFormat(function ($data) {
|
|
$arr = json_decode($data,true);
|
|
$arr = json_decode($data,true);
|
|
- foreach ($arr as $key => $value) {
|
|
|
|
- if (isset($arr[$key]['order']) == false) {
|
|
|
|
- $arr[$key]['order'] = 0;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- // 按 order 字段对数组进行排序
|
|
|
|
- usort($arr, function($a, $b) {
|
|
|
|
- #return $a['order'] <=> $b['order']; // 升序排序
|
|
|
|
- // 如需降序排序:return $b['order'] <=> $a['order'];
|
|
|
|
- return $b['order'] <=> $a['order'];
|
|
|
|
- });
|
|
|
|
|
|
+ $arr = CommonHelper::orderByAlbumVideo($arr);
|
|
return $arr;
|
|
return $arr;
|
|
})
|
|
})
|
|
->setView('admin.form_custom.hasmanytable')
|
|
->setView('admin.form_custom.hasmanytable')
|