feat: 1, 7월마다 유산 포인트 rank_data 통계를 냄

This commit is contained in:
2022-05-10 01:59:10 +09:00
parent fa5546874a
commit 91bc734612
2 changed files with 21 additions and 0 deletions
+19
View File
@@ -1,10 +1,29 @@
<?php
namespace sammo;
use sammo\Enums\RankColumn;
/**
* 시간 단위로 일어나는 이벤트들에 대한 함수 모음
*/
function processSumInheritPointRank(){
$db = DB::db();
$db->update(
'UPDATE `rank_data` D SET `value` = (SELECT SUM(`value`) FROM `rank_data` S WHERE S.general_id = D.general_id AND S.`type` IN %ls) WHERE D.`type` = %s',
[RankColumn::inherit_point_earned_by_action->value, RankColumn::inherit_point_earned_by_merge->value],
RankColumn::inherit_point_earned->value
);
$db->update(
'UPDATE `rank_data` D SET `value` = (SELECT `value` FROM `rank_data` S WHERE S.general_id = D.general_id AND S.`type` = %s) WHERE D.`type` = %s',
RankColumn::inherit_point_spent_dynamic->value,
RankColumn::inherit_point_spent->value
);
}
//1월마다 실행
function processSpring() {
$db = DB::db();
+2
View File
@@ -411,6 +411,7 @@ class TurnExecutionHelper
// 분기계산. 장수들 턴보다 먼저 있다면 먼저처리
if ($gameStor->month == 1) {
processSumInheritPointRank();
processSpring();
processGoldIncome();
updateYearly();
@@ -425,6 +426,7 @@ class TurnExecutionHelper
updateQuaterly();
disaster();
} elseif ($gameStor->month == 7) {
processSumInheritPointRank();
processFall();
processRiceIncome();
updateQuaterly();