Ver Fonte

优化大小球限制逻辑

flyzto há 2 semanas atrás
pai
commit
84093ce133
1 ficheiros alterados com 11 adições e 9 exclusões
  1. 11 9
      server/models/GamesPs.js

+ 11 - 9
server/models/GamesPs.js

@@ -317,21 +317,24 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
         if (isRb && (ior.startsWith('ior_r') || ior.startsWith('ior_m') || ior.startsWith('ior_wm')) && subsidyRbWmAmount) {
           const sourceOdds = events[ior].v;
           events[ior].v = fixFloat(sourceOdds * (1 + subsidyRbWmAmount), 3);
-          events[ior].s = sourceOdds
+          events[ior].s = sourceOdds;
         }
         // 滚球进球数补水
         // API采集特殊盘口用
         else if (isRb && ior.startsWith('ior_ot') && subsidyRbOtAmount) {
           const sourceOdds = events[ior].v;
           events[ior].v = fixFloat(sourceOdds * (1 + subsidyRbOtAmount), 3);
-          events[ior].s = sourceOdds
+          events[ior].s = sourceOdds;
         }
         // 赛前进球数补水
         // API采集特殊盘口用
         else if (!isRb && isSubsidy && ior.startsWith('ior_ot') && subsidyAmount) {
           const sourceOdds = events[ior].v;
           events[ior].v = fixFloat(sourceOdds * (1 + subsidyAmount), 3);
-          events[ior].s = sourceOdds
+          events[ior].s = sourceOdds;
+        }
+        else if (ior.startsWith('ior_r') || ior.startsWith('ior_ou')) {
+          events[ior].q = events[ior]?.v < innerOuMinValue ? 0 : 1;
         }
       });
       baseGame.originId = originId;
@@ -400,14 +403,12 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
       const matches = PS_IOR_KEYS.map(([label, ...keys]) => {
         let match = keys.map(key => {
           let value = odds[key]?.v ?? 0;
-          if (key.startsWith('ior_ou') && value < innerOuMinValue) {
-            value = 0;
-          }
           return {
             key, value,
             origin: odds[key]?.r,
             source: odds[key]?.s,
-          }
+            quality: odds[key]?.q ?? 1,
+          };
         });
         if (label == 'jqs' || label == 'ou') {
           match = match.filter(item => item.value !== 0);
@@ -457,11 +458,12 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
       if (relatedGame) {
         const events = {};
         matches.forEach(({ label, match }) => {
-          match.forEach(({ key, value, origin, source }) => {
+          match.forEach(({ key, value, origin, source, quality }) => {
             events[key] = {
               v: value,
               r: origin,
-              s: source
+              s: source,
+              q: quality,
             };
           });
         });