更新:后台组图提交时重置数组顺序

virtual
zwesy 2020-12-10 12:13:24 +08:00
parent 76c08939a0
commit 66047618a4
2 changed files with 2 additions and 0 deletions

View File

@ -120,6 +120,7 @@ class Content extends Base
if(!empty($groupIds)){
foreach($groupIds as $key => $groupId){
$group = $groups[$groupId] ?? [];
$group = array_values($group);
$data[] = [
'id' => $groupId,
'value' => json_encode($group)

View File

@ -326,6 +326,7 @@ class Page extends Base
$imgs = input('post.img/a');
$categoryId = input('post.category_id/d');
if (!empty($imgs) && is_array($imgs)) {
$imgs = array_values($imgs);
$item['value'] = json_encode($imgs);
} else {
$item['value'] = '';