From a7fe530a7517c048a6a81577fb24090337a10e65 Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Mon, 16 Mar 2015 22:02:00 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20=E6=8E=A8=E8=96=A6=E5=AD=B8=E7=BF=92?= =?UTF-8?q?=E9=BB=9E=E6=99=82=E7=9A=84=E5=85=B6=E4=BB=96=E7=8B=80=E6=B3=81?= =?UTF-8?q?=EF=BC=88=E5=AD=B8=E7=BF=92=E5=AE=8C=E6=88=90=E3=80=81=E6=99=82?= =?UTF-8?q?=E9=96=93=E5=B7=B2=E9=81=8E=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/api/v2/index.php | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/htdocs/api/v2/index.php b/htdocs/api/v2/index.php index 22ea497..1a8dbc0 100644 --- a/htdocs/api/v2/index.php +++ b/htdocs/api/v2/index.php @@ -1225,17 +1225,15 @@ $app->group('/tokens', 'APIrequest', function () use ($app, $app_template) { if($sact->isForceLearnTime() && $sact->getRemainingTime() <= 0) { $isEnd = true; - $recommandResult = array(); - $result_recommand_total = array(); - $recommandTotal = 0; + $result_recommand_total = 0; + $output_targets = array(); } // 是否已經學完了 else if($sact->getRemainingPointTotal() <= 0) { $isEnd = true; - $recommandResult = array(); - $result_recommand_total = array(); - $recommandTotal = 0; + $result_recommand_total = 0; + $output_targets = array(); } else { $isEnd = false; @@ -1250,14 +1248,14 @@ $app->group('/tokens', 'APIrequest', function () use ($app, $app_template) { else { $result_recommand_total = $recommandTotal; } - } - // 製作 - $output_targets = array(); - for($i=0; $i<$result_recommand_total; $i++) { - $target_id = $recommandResult[$i]['nextPoint']; - $isEntity = $recommandResult[$i]['isEntity']; - array_push($output_targets, output_the_target_array($target_id, $isEntity, $materialMode)); + // 製作 + $output_targets = array(); + for($i=0; $i<$result_recommand_total; $i++) { + $target_id = $recommandResult[$i]['nextPoint']; + $isEntity = $recommandResult[$i]['isEntity']; + array_push($output_targets, output_the_target_array($target_id, $isEntity, $materialMode)); + } } // 噴出結果 @@ -1370,17 +1368,15 @@ $app->group('/tokens', 'APIrequest', function () use ($app, $app_template) { if($sact->isForceLearnTime() && $sact->getRemainingTime() <= 0) { $isEnd = true; - $recommandResult = array(); - $result_recommand_total = array(); - $recommandTotal = 0; + $result_recommand_total = 0; + $output_targets = array(); } // 是否已經學完了 else if($sact->getRemainingPointTotal() <= 0) { $isEnd = true; - $recommandResult = array(); - $result_recommand_total = array(); - $recommandTotal = 0; + $result_recommand_total = 0; + $output_targets = array(); } else { $isEnd = false;