shawenguan пре 1 година
родитељ
комит
b5722262b2
2 измењених фајлова са 25 додато и 3 уклоњено
  1. 8 0
      BoxJsSub/168.json
  2. 17 3
      Scripts/168/pksPlanAnalysis.js

+ 8 - 0
BoxJsSub/168.json

@@ -190,6 +190,14 @@
                     "desc": "专家下注最大限额"
                 },
                 {
+                    "id": "168_PksAnalysisMinRecordCount",
+                    "name": "分析数据记录最少数目",
+                    "val": 100,
+                    "type": "number",
+                    "placeholder": "",
+                    "desc": "分析数据记录最少数目"
+                },
+                {
                     "id": "168_PksPlanDrawIssueCustom",
                     "name": "自定义计划期数-测试",
                     "val": "",

+ 17 - 3
Scripts/168/pksPlanAnalysis.js

@@ -371,15 +371,29 @@ function getExpertPlanMaxBetAmount() {
 	return Number(amount);
 }
 
+function getAnalysisRecordCount() {
+	let amount = magicJS.data.read('168_PksAnalysisMinRecordCount', null);
+	if (amount == null) {
+		return 100;
+	}
+	return Number(amount);
+}
+
 async function tryAnalysis() {
 	let nowDate = formatNow();
 	let historyList = await getPksHistoryList(gLotteryCode, nowDate);
 	if (!historyList) {
 		return;
 	}
-	if (historyList.length < 100) {
-		let preHistoryList = await getPksHistoryList(gLotteryCode, formatPreviousDate(1));
-		historyList = historyList.concat(preHistoryList);
+	let minRecordCOunt = getAnalysisRecordCount();
+	if (historyList.length < minRecordCOunt) {
+		for (let i = 0; i < 10; i++) {
+			let preHistoryList = await getPksHistoryList(gLotteryCode, formatPreviousDate(i + 1));
+			historyList = historyList.concat(preHistoryList);
+			if (historyList.length >= minRecordCOunt) {
+				break;
+			}
+		}
 	}
 	let count = historyList.length;
 	let allNumDict = [];