Fix: get_typing_exam_history_record
This commit is contained in:
@@ -12,5 +12,4 @@ class DBMethodContainer
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -53,7 +53,5 @@ if ($command === "addTypingExamHighestRecord") {
|
||||
$jsonBuilder->setData("typingExamHighestRecordData", $typingExamHighestRecordData);
|
||||
}
|
||||
|
||||
|
||||
$jsonBuilder->sendResultSuccess();
|
||||
|
||||
?>
|
||||
@@ -46,7 +46,5 @@ if ($command === "deleteWritingRecordAll") {
|
||||
// $jsonBuilder->setData("deleteTypingExamHighestRecordAll", "succeeded");
|
||||
}
|
||||
|
||||
|
||||
$jsonBuilder->sendResultSuccess();
|
||||
|
||||
?>
|
||||
@@ -161,6 +161,28 @@ class TypingExamCollection extends DBMethodContainer
|
||||
$stmt->close();
|
||||
}
|
||||
|
||||
}
|
||||
function getHistoryRecord($maestroID, $playerID, $writingID, $date) {
|
||||
$query = "
|
||||
SELECT DATE(RecordDateTime), MAX(Record)
|
||||
FROM typing_exam_record
|
||||
WHERE MaestroID = ? AND PlayerID = ? AND DATE(RecordDateTime) <= ? AND WritingID = ?
|
||||
GROUP BY DATE(RecordDateTime)
|
||||
ORDER BY RecordDateTime DESC
|
||||
LIMIT 7";
|
||||
$stmt = $this->mysqli->prepare($query);
|
||||
$stmt->bind_param('iisi', $maestroID, $playerID, $date, $writingID);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($date, $highestRecord);
|
||||
|
||||
$historyRecordArray = array();
|
||||
while($stmt->fetch()) {
|
||||
$historyRecord['Date'] = $date;
|
||||
$historyRecord['HighScore'] = $highestRecord;
|
||||
$historyRecord['AppName'] = "TypingExam";
|
||||
array_push($historyRecordArray, $historyRecord);
|
||||
}
|
||||
|
||||
return $historyRecordArray;
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -54,5 +54,4 @@ class WritingCollection extends DBMethodContainer
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user