refac: inheritance_result로 데이터 이관
This commit is contained in:
@@ -99,7 +99,7 @@ class Join extends \sammo\BaseAPI
|
|||||||
}
|
}
|
||||||
|
|
||||||
$gameID = UniqueConst::$serverID;
|
$gameID = UniqueConst::$serverID;
|
||||||
$alreadyJoined = $db->queryFirstField('SELECT count(*) FROM `storage` WHERE `namespace` = %s AND `key` LIKE %s', 'inheritance_result', "{$gameID}_{$userID}_%");
|
$alreadyJoined = $db->queryFirstField('SELECT COUNT(*) FROM `inheritance_result` WHERE `server_id` = %s AND `owner` = %i', $gameID, $userID);
|
||||||
if ($alreadyJoined) {
|
if ($alreadyJoined) {
|
||||||
//이미 받았음
|
//이미 받았음
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -334,11 +334,19 @@ class InheritancePointManager
|
|||||||
$inheritStor->setValue($key, [$point, $aux]);
|
$inheritStor->setValue($key, [$point, $aux]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$oldInheritStor = KVStorage::getStorage(DB::db(), "inheritance_result");
|
$db = DB::db();
|
||||||
$serverID = UniqueConst::$serverID;
|
$serverID = UniqueConst::$serverID;
|
||||||
$year = $gameStor->year;
|
$year = $gameStor->year;
|
||||||
$month = $gameStor->month;
|
$month = $gameStor->month;
|
||||||
$oldInheritStor->setValue("{$serverID}_{$ownerID}_{$general->getID()}_{$year}_{$month}", $inheritStor->getAll(true));
|
|
||||||
|
$db->insert('inheritance_result', [
|
||||||
|
'owner'=>$ownerID,
|
||||||
|
'server'=>$serverID,
|
||||||
|
'general_id'=>$general->getID(),
|
||||||
|
'year'=>$year,
|
||||||
|
'month'=>$month,
|
||||||
|
'value'=>$inheritStor->getAll(true)
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user