From cb09e4497ff612a65446ff41993ed0a69d274698 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 1 Jul 2022 14:29:40 +0800 Subject: [PATCH] 1 --- .../controller/TempToolsController.class.php | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/webapp/controller/TempToolsController.class.php b/webapp/controller/TempToolsController.class.php index e785c111..0072da54 100644 --- a/webapp/controller/TempToolsController.class.php +++ b/webapp/controller/TempToolsController.class.php @@ -109,13 +109,45 @@ class TempToolsController extends BaseController { $account['name'] = $row['name']; } } - echo 'account_id,name,rank,score,time' . "\n"; + { + foreach ($accounts as &$account) { + $row = $conn->execQuery( + 'SELECT MAX(hero_lv) AS max_hero_lv FROM t_hero WHERE account_id=:account_id', + array( + ':account_id' => $account['account_id'], + ) + ); + $account['max_hero_lv'] = $row['max_hero_lv']; + } + } + { + foreach ($accounts as &$account) { + $row = $conn->execQuery( + 'SELECT MAX(quality) AS max_hero_quality FROM t_hero WHERE account_id=:account_id', + array( + ':account_id' => $account['account_id'], + ) + ); + $account['max_hero_quality'] = $row['max_hero_quality']; + } + } + echo 'account_id,name,rank,score,max_hero_lv,max_hero_quality,flag, time' . "\n"; foreach ($accounts as $account) { + $flag = 0; + if ($type == 3) { + $flag = $account['max_hero_lv'] != $account['score'] ? 1 : 0; + } + if ($type == 4) { + $flag = $account['max_hero_quality'] != $account['score'] ? 1 : 0; + } echo phpcommon\extractOpenId($account['account_id']) . ',' . $account['name'] . ',' . $account['ranked'] . ',' . $account['score'] . ',' + . $account['max_hero_lv'] . ',' + . $account['max_hero_quality'] . ',' + . $flag . ',' . phpcommon\timestamp_to_datetime($account['modifytime']) . "\n"; }