forked from devsam/core
feat: 1, 7월마다 유산 포인트 rank_data 통계를 냄
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user