|
|
@@ -1024,7 +1024,7 @@ async function checkPlanABuyNotify(pksPlanItemData, pksPlanListData) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-function getPlanFixCost(pksPlanListData, turnOneCost) {
|
|
|
+function getPlanFixCost(pksPlanListData, turnOneCost, ranking = 1) {
|
|
|
if (!pksPlanListData) {
|
|
|
return turnOneCost;
|
|
|
}
|
|
|
@@ -1049,6 +1049,29 @@ function getPlanFixCost(pksPlanListData, turnOneCost) {
|
|
|
turnOneCost = turnOneCost + Math.pow(2, fixCount - 1);
|
|
|
}
|
|
|
}
|
|
|
+ let posIndex = ranking - 1;
|
|
|
+ let continuousNumDict = {};
|
|
|
+ let tmpDrawNum = null;
|
|
|
+ for (let i = 1; i < pksPlanListData.length; i++) {
|
|
|
+ const item = pksPlanListData[i];
|
|
|
+ const numArr = item.preDrawIssue.split(',');
|
|
|
+ if (tmpDrawNum) {
|
|
|
+ if (numArr[posIndex] == tmpDrawNum) {
|
|
|
+ if (!continuousNumDict[tmpDrawNum]) {
|
|
|
+ continuousNumDict[tmpDrawNum] = 0;
|
|
|
+ }
|
|
|
+ continuousNumDict[tmpDrawNum] += 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tmpDrawNum = numArr[posIndex];
|
|
|
+ }
|
|
|
+ let continuousNumTotalCnt = 0;
|
|
|
+ for (let k in continuousNumDict) {
|
|
|
+ continuousNumTotalCnt += continuousNumDict[k];
|
|
|
+ }
|
|
|
+ if (continuousNumTotalCnt > 0) {
|
|
|
+ turnOneCost = Math.ceil(turnOneCost / continuousNumTotalCnt);
|
|
|
+ }
|
|
|
return turnOneCost;
|
|
|
}
|
|
|
|