更新:后台组图提交时重置数组顺序
parent
76c08939a0
commit
66047618a4
|
@ -120,6 +120,7 @@ class Content extends Base
|
||||||
if(!empty($groupIds)){
|
if(!empty($groupIds)){
|
||||||
foreach($groupIds as $key => $groupId){
|
foreach($groupIds as $key => $groupId){
|
||||||
$group = $groups[$groupId] ?? [];
|
$group = $groups[$groupId] ?? [];
|
||||||
|
$group = array_values($group);
|
||||||
$data[] = [
|
$data[] = [
|
||||||
'id' => $groupId,
|
'id' => $groupId,
|
||||||
'value' => json_encode($group)
|
'value' => json_encode($group)
|
||||||
|
|
|
@ -326,6 +326,7 @@ class Page extends Base
|
||||||
$imgs = input('post.img/a');
|
$imgs = input('post.img/a');
|
||||||
$categoryId = input('post.category_id/d');
|
$categoryId = input('post.category_id/d');
|
||||||
if (!empty($imgs) && is_array($imgs)) {
|
if (!empty($imgs) && is_array($imgs)) {
|
||||||
|
$imgs = array_values($imgs);
|
||||||
$item['value'] = json_encode($imgs);
|
$item['value'] = json_encode($imgs);
|
||||||
} else {
|
} else {
|
||||||
$item['value'] = '';
|
$item['value'] = '';
|
||||||
|
|
Loading…
Reference in New Issue