Skip to content

Commit ee3c1d4

Browse files
author
JiangRuYi
committed
编辑模型表单显示排序修复
1 parent f5c9970 commit ee3c1d4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

wwwroot/Application/Admin/Controller/ModelController.class.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,21 @@ public function edit(){
7676
$fields[$key]['is_show'] = 0;
7777
}
7878
}
79+
7980
// 获取模型排序字段
8081
$field_sort = json_decode($data['field_sort'], true);
8182
if(!empty($field_sort)){
8283
foreach($field_sort as $group => $ids){
83-
foreach($ids as $key){
84-
$fields[$key]['group'] = $group;
84+
foreach($ids as $key => $value){
85+
$fields[$value]['group'] = $group;
86+
$fields[$value]['sort'] = $key;
8587
}
8688
}
8789
}
90+
91+
// 模型字段列表排序
92+
$fields = list_sort_by($fields,"sort");
93+
8894
$this->assign('fields', $fields);
8995
$this->assign('info', $data);
9096
$this->meta_title = '编辑模型';

0 commit comments

Comments
 (0)