flyzto 2 月之前
父節點
當前提交
50b3432999
共有 1 個文件被更改,包括 9 次插入5 次删除
  1. 9 5
      server/triangle/trangleCalc.js

+ 9 - 5
server/triangle/trangleCalc.js

@@ -7,10 +7,14 @@ const { eventSolutions } = require('./eventSolutions');
 /**
  * 筛选最优赔率
  */
-const oddRebateValue = (odds, platform) => {
+const oddRebateValue = (odds, platform, key) => {
   const setting = getSetting();
-  const rebateRatio = setting[`${platform}RebateRatio`] ?? 0;
-  const rebateType = setting[`${platform}RebateType`] ?? 0;
+  let rebateRatio = setting[`${platform}RebateRatio`] ?? 0;
+  let rebateType = setting[`${platform}RebateType`] ?? 0;
+
+  if (platform == 'hg' && key.startsWith('ior_m')) {
+    rebateRatio -= 0.75;
+  }
   if (rebateType == 0) {
     return odds * (1 + rebateRatio / 100);
   }
@@ -58,8 +62,8 @@ const getOptimalSelections = (odds, rules) => {
           }
           // Logs.out('candidates', candidates)
           const best = candidates.reduce((a, b) => {
-            const aValue = oddRebateValue(item[a].v-1, a);
-            const bValue = oddRebateValue(item[b].v-1, b);
+            const aValue = oddRebateValue(item[a].v-1, a, key);
+            const bValue = oddRebateValue(item[b].v-1, b, key);
             const seletcted = aValue > bValue ? a : b;
             return seletcted;
           });