From b50f879ce5dbae11734922592278826b8f5fab60 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sat, 9 Nov 2024 19:00:56 +0800 Subject: [PATCH] 1 --- webapp/services/CircuitRankingService.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/webapp/services/CircuitRankingService.php b/webapp/services/CircuitRankingService.php index ca4bcf4e..ea0af342 100644 --- a/webapp/services/CircuitRankingService.php +++ b/webapp/services/CircuitRankingService.php @@ -209,6 +209,7 @@ class CircuitRankingService extends BaseService { } } $sortRows = myself()->arraySort($data, 'cumulative_score', 'desc'); + $sortRows = self::toArray($sortRows); /* { if (SERVER_ENV != _ONLINE) { @@ -232,6 +233,7 @@ class CircuitRankingService extends BaseService { //21-100之间的名次 塞入35名 //101-200之间的名次 塞入40名 $sortAndroids = myself()->arraySort($androids, 'cumulative_score', 'desc'); + $sortAndroids = self::toArray($sortAndroids); $lastScore = $maxScore; for ($i = 0; $i < 75; ++$i) { if (20 + $i > count($sortRows)) { @@ -317,4 +319,13 @@ class CircuitRankingService extends BaseService { ); } + private static function toArray($data) + { + $arr = array(); + foreach ($data as $k=>$row){ + array_push($arr, $v); + } + return $arr; + } + }