feat: 설문조사 정보도 DB정보를 이용하여 한번만 처리
This commit is contained in:
@@ -569,6 +569,14 @@ class GetFrontInfo extends \sammo\BaseAPI
|
|||||||
|
|
||||||
//TODO: 마지막 투표, 토너먼트, 베팅을 했는지 정보를 별도로 가져와야 함. aux?
|
//TODO: 마지막 투표, 토너먼트, 베팅을 했는지 정보를 별도로 가져와야 함. aux?
|
||||||
|
|
||||||
|
$auxInfo = [];
|
||||||
|
|
||||||
|
if ($globalInfo['lastVote']) {
|
||||||
|
$myLastVoteID = $db->queryFirstField('SELECT vote_id FROM vote WHERE general_id = %i ORDER BY vote_id DESC LIMIT 1', $generalID);
|
||||||
|
if($myLastVoteID) {
|
||||||
|
$auxInfo['myLastVote'] = $myLastVoteID;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'result' => true,
|
'result' => true,
|
||||||
@@ -577,6 +585,7 @@ class GetFrontInfo extends \sammo\BaseAPI
|
|||||||
'nation' => $nationInfo,
|
'nation' => $nationInfo,
|
||||||
'general' => $generalInfo,
|
'general' => $generalInfo,
|
||||||
'city' => $cityInfo,
|
'city' => $cityInfo,
|
||||||
|
'aux' => $auxInfo,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -459,7 +459,7 @@ watch(refreshCounter, async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const lastVoteID = response.global.lastVoteID;
|
const lastVoteID = response.global.lastVoteID;
|
||||||
if (lastVoteID > lastVoteState.value) {
|
if (lastVoteID > lastVoteState.value && lastVoteID > (response.aux.myLastVote ?? 0)) {
|
||||||
lastVoteState.value = lastVoteID;
|
lastVoteState.value = lastVoteID;
|
||||||
toasts.warning(
|
toasts.warning(
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -221,6 +221,9 @@ export type GetFrontInfoResponse = {
|
|||||||
} | null
|
} | null
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
aux: {
|
||||||
|
myLastVote?: number;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user