feat: 1, 7월마다 유산 포인트 rank_data 통계를 냄
This commit is contained in:
@@ -1,10 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace sammo;
|
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월마다 실행
|
//1월마다 실행
|
||||||
function processSpring() {
|
function processSpring() {
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
|
|||||||
@@ -411,6 +411,7 @@ class TurnExecutionHelper
|
|||||||
|
|
||||||
// 분기계산. 장수들 턴보다 먼저 있다면 먼저처리
|
// 분기계산. 장수들 턴보다 먼저 있다면 먼저처리
|
||||||
if ($gameStor->month == 1) {
|
if ($gameStor->month == 1) {
|
||||||
|
processSumInheritPointRank();
|
||||||
processSpring();
|
processSpring();
|
||||||
processGoldIncome();
|
processGoldIncome();
|
||||||
updateYearly();
|
updateYearly();
|
||||||
@@ -425,6 +426,7 @@ class TurnExecutionHelper
|
|||||||
updateQuaterly();
|
updateQuaterly();
|
||||||
disaster();
|
disaster();
|
||||||
} elseif ($gameStor->month == 7) {
|
} elseif ($gameStor->month == 7) {
|
||||||
|
processSumInheritPointRank();
|
||||||
processFall();
|
processFall();
|
||||||
processRiceIncome();
|
processRiceIncome();
|
||||||
updateQuaterly();
|
updateQuaterly();
|
||||||
|
|||||||
Reference in New Issue
Block a user