Fix: menu app data list
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -28,7 +28,7 @@ include "./../db/menu_collection.php";
|
||||
$menuCollection = new MenuCollection($dbConnector->getMysqli());
|
||||
$appList = $menuCollection->getAppList($maestroID, $playerID, $appGroup, $language);
|
||||
$activeAppList = $menuCollection->getActiveAppList($maestroID, $playerID, $appGroup, $language);
|
||||
$highestRecordList = $menuCollection->getHighestRecordList($maestroID, $playerID, $appGroup, $language);
|
||||
$highestRecordList = $menuCollection->getHighestRecordList($maestroID, $playerID, $appList);
|
||||
|
||||
$jsonBuilder->setData("appGroupName", $menuCollection->getAppGroupName($appGroup));
|
||||
$jsonBuilder->setData("languageName", $menuCollection->getLanguageName($language));
|
||||
|
||||
Reference in New Issue
Block a user