Fix: menu app data list

This commit is contained in:
2019-08-10 17:44:29 +09:00
parent 467eef9763
commit 8e7fe46905
3 changed files with 213 additions and 17 deletions
+34 -6
View File
@@ -178,26 +178,54 @@ class MenuCollection extends DBMethodContainer
// highest record list
public function getHighestRecordList($maestroID, $playerID, $appGroup, $language)
public function getHighestRecordList($maestroID, $playerID, $appList)
{
switch($appGroup) {
case 0: // typing finger position
case 1: // typing practice
case 3: // typing play
return $this->getTypingHighestRecordList($maestroID, $playerID, $appGroup, $language);
return $this->getTypingHighestRecordList($maestroID, $playerID, $appList);
case 2:
// return $this->getTypingExamHighestRecordWritingList($maestroID, $playerID, $appGroup, $language);
case 3: // typing play
case 4: // mouse play
// return $this->getMouseHighestRecordList($maestroID, $playerID, $appGroup);
return null;
break;
}
}
public function getTypingHighestRecordList($maestroID, $playerID, $appGroup, $language)
public function getTypingHighestRecordList($maestroID, $playerID, $appList)
{
return null;
$highestRecordArray = array();
$count = count($appList);
for($i = 0; $i < $count; $i++) {
$appID = $appList[$i]["appID"];
$highestRecord["appID"] = $appID;
$highestRecord["HighestRecord"] = $this->getTypingHighestRecord($maestroID, $playerID, $appID);
array_push($highestRecordArray, $highestRecord);
}
return $highestRecordArray;
}
public function getTypingHighestRecord($maestroID, $playerID, $appID)
{
$query = "
SELECT HighestRecord
FROM app_highest_record
WHERE MaestroID=? AND PlayerID=? AND AppID=?";
$stmt = $this->mysqli->prepare($query);
$stmt->bind_param("iii", $maestroID, $playerID, $appID);
$stmt->execute();
$stmt->bind_result($highestRecord);
$returnValue = $stmt->fetch();
$stmt->close();
if($returnValue === NULL || $returnValue === FALSE)
return 0;
return $highestRecord;
}
public function getTypingExamHighestRecordWritingList($maestroID, $playerID, $appGroup, $language)