diff --git a/framework/helper.class.php b/framework/helper.class.php index e0d587e901..029ba92861 100644 --- a/framework/helper.class.php +++ b/framework/helper.class.php @@ -801,6 +801,15 @@ function debug($message = '', $file = 'undefined', $line = 0) $app->saveError(E_USER_WARNING, $message, $file, $line); } +/** + * 为数组使用字母排序。 + * Use alphabetical sorting for arrays. + * + * @param array $data + * @param string $fieldName + * @param string $suffix + * @return void + */ function addPrefixToField(&$data, $fieldName, $suffix = '. ') { $key = 0; @@ -817,6 +826,10 @@ function addPrefixToField(&$data, $fieldName, $suffix = '. ') { $item[$fieldName] = $prefix . $suffix . $item[$fieldName]; } + else + { + $item->{$fieldName} = $prefix . $suffix . $item->{$fieldName}; + } $key++; } }