Fix getRemainingPointTotal 不包含入口本身 & Fix API Recommand is_end
This commit is contained in:
parent
009d8eea2c
commit
86b3e562a6
@ -1208,9 +1208,12 @@ $app->group('/tokens', 'APIrequest', function () use ($app, $app_template) {
|
||||
$result_recommand_total = $recommandTotal;
|
||||
}
|
||||
// 是否已經學完了
|
||||
// TODO: 改以取得已學習標的數來判定
|
||||
if($recommandTotal <= 0) { $isEnd = true; }
|
||||
else { $isEnd = false; }
|
||||
if($sact->getRemainingPointTotal() <= 0) {
|
||||
$isEnd = true;
|
||||
}
|
||||
else {
|
||||
$isEnd = false;
|
||||
}
|
||||
|
||||
// 製作
|
||||
$output_targets = array();
|
||||
|
@ -163,11 +163,14 @@ class RecommandPoint
|
||||
"VirtualCost"=>$virtualCost));
|
||||
}
|
||||
|
||||
if(count($recommand) >= 1) {
|
||||
|
||||
foreach($recommand as $key=>$value)
|
||||
{
|
||||
$tmp[$key] = $value["PathCost"];
|
||||
}
|
||||
array_multisort($tmp,SORT_DESC,$recommand,SORT_DESC);
|
||||
}
|
||||
|
||||
return $recommand;
|
||||
}
|
||||
|
@ -171,7 +171,7 @@ class StudyActivity {
|
||||
$total = $this->getPointTotal();
|
||||
$learned = $this->getLearnedPointTotal();
|
||||
|
||||
return $total - $learned;
|
||||
return ($total-1) - $learned;
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user