From 85ccecd34510ad23658123b09b2f723a99027a74 Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Wed, 23 Aug 2023 17:47:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=92=E4=BD=8D=E7=BB=93?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/models/RankingSetRecord.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/webapp/models/RankingSetRecord.php b/webapp/models/RankingSetRecord.php index 71893f06..c5d1d3d5 100644 --- a/webapp/models/RankingSetRecord.php +++ b/webapp/models/RankingSetRecord.php @@ -23,7 +23,7 @@ class RankingSetRecord } public static function toDto($row){ - return array( + $data = array( 'state' => $row['state'], 'last_rank' => $row['last_rank'], 'current_rank' => $row['current_rank'], @@ -31,6 +31,21 @@ class RankingSetRecord 'current_score' => $row['current_score'], 'awards' => json_decode($row['awards']), ); + self::updateState(); + return $data; + } + + public static function updateState(){ + SqlHelper::update + (myself()->_getSelfMysql(), + 't_ranking_settlement_record', + array( + 'account_id' => myself()->_getAccountId(), + ), + array( + 'state' => 0, + ) + ); } public static function upsert($fieldKv){