File tree Expand file tree Collapse file tree
vendor/phalapi/kernal/src/Helper Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,7 +193,8 @@ public function render($tplPath = NULL) {
193193 if ($ this ->apiListSortBy == self ::API_LIST_SORT_BY_API_TITLE ) {
194194 // 根据自定义接口标题排序
195195 $ sortTiles = array_column ($ subAllApiS , 'title ' );
196- array_multisort ($ subAllApiS , SORT_ASC , SORT_STRING , $ sortTiles );
196+ // @link https://www.php.net/manual/zh/function.array-multisort.php 示例 #4
197+ array_multisort ($ sortTiles , SORT_ASC , SORT_STRING , $ subAllApiS );
197198 } else {
198199 // 默认根据接口名称排序
199200 ksort ($ subAllApiS );
@@ -203,7 +204,7 @@ public function render($tplPath = NULL) {
203204 foreach ($ subAllApiS as &$ subMethods ) {
204205 if ($ this ->apiListSortBy == self ::API_LIST_SORT_BY_API_TITLE ) {
205206 $ subSortTitles = array_column ($ subMethods ['methods ' ], 'title ' );
206- array_multisort ($ subMethods [ ' methods ' ] , SORT_ASC , SORT_STRING , $ subSortTitles );
207+ array_multisort ($ subSortTitles , SORT_ASC , SORT_STRING , $ subMethods [ ' methods ' ] );
207208 } else {
208209 ksort ($ subMethods );
209210 }
You can’t perform that action at this time.
0 commit comments