Fix: search button

This commit is contained in:
2019-03-30 15:27:45 +09:00
parent f75194f6b1
commit 435e526e8b
3 changed files with 42 additions and 59 deletions
@@ -28,7 +28,6 @@ $subject_statement = makeSubjectSentence($app_id);
// echo "subject : ".$subject_statement."\n";
$where_statement = make_where_statement($date_statement, $player_name_statement, $subject_statement);
$recordCount = get_player_record_count($maestro_id, $where_statement, $limit_count);
$recordTotalCount = get_player_record_total_count($maestro_id, $where_statement);
$replyJSON = get_player_record_list($maestro_id, $where_statement, $limit_count);
if($replyJSON.length === 0) {
@@ -37,7 +36,7 @@ if($replyJSON.length === 0) {
exit;
}
set_data("RecordCount", $recordCount);
set_data("RecordTotalCount", $recordTotalCount);
set_data("RecordList", $replyJSON);
send_result_success();
exit;
@@ -113,6 +112,7 @@ function make_where_statement($date_statement, $player_name_statement, $subject_
return $where_statement;
}
/*
function get_player_record_count($maestro_id, $where_statement, $limit_count) {
global $db_conn;
@@ -137,6 +137,7 @@ function get_player_record_count($maestro_id, $where_statement, $limit_count) {
return $record_count;
}
*/
function get_player_record_total_count($maestro_id, $where_statement) {
global $db_conn;
@@ -168,7 +169,7 @@ function get_player_record_list($maestro_id, $where_statement, $limit_count) {
P.Name AS Name, A.KoreanName AS Subject, BR.BestRecord AS Record
FROM best_record BR, player P, App A
WHERE BR.MaestroID = ? AND ".$where_statement."
ORDER BY BR.RecordDateTime ASC
ORDER BY BR.RecordDateTime DESC
";
if($limit_count > 0)
@@ -28,7 +28,6 @@ $subject_statement = makeSubjectSentence($app_id);
// echo "subject : ".$subject_statement."\n";
$where_statement = make_where_statement($date_statement, $player_name_statement, $subject_statement);
$recordCount = get_player_record_count($maestro_id, $where_statement, $limit_count);
$recordTotalCount = get_player_record_total_count($maestro_id, $where_statement);
$replyJSON = get_player_record_list($maestro_id, $where_statement, $limit_count);
if($replyJSON.length === 0) {
@@ -37,7 +36,7 @@ if($replyJSON.length === 0) {
exit;
}
set_data("RecordCount", $recordCount);
set_data("RecordTotalCount", $recordTotalCount);
set_data("RecordList", $replyJSON);
send_result_success();
exit;
@@ -115,6 +114,7 @@ function make_where_statement($date_statement, $player_name_statement, $subject_
return $where_statement;
}
/*
function get_player_record_count($maestro_id, $where_statement, $limit_count) {
global $db_conn;
@@ -139,6 +139,7 @@ function get_player_record_count($maestro_id, $where_statement, $limit_count) {
return $record_count;
}
*/
function get_player_record_total_count($maestro_id, $where_statement) {
global $db_conn;
@@ -170,7 +171,7 @@ function get_player_record_list($maestro_id, $where_statement, $limit_count) {
P.Name AS Name, LS.SubjectName AS Subject, LS.Score AS Record
FROM license_score LS, player P
WHERE LS.MaestroID = ? AND ".$where_statement."
ORDER BY LS.ScoreDateTime ASC
ORDER BY LS.ScoreDateTime DESC
";
if($limit_count > 0)