Bläddra i källkod

放开胜平负缺一个的组合

flyzto 3 veckor sedan
förälder
incheckning
66520b0671

+ 5 - 6
server/models/GamesPs.js

@@ -421,12 +421,11 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
           return item.match.length;
         }
         else {
-          return item.match.every(entry => {
-            // if (entry.key == '-' || entry.key.startsWith('ior_ou')) {
-            //   return true;
-            // }
-            return entry.value !== 0;
-          });
+          // return item.match.every(entry => {
+          //   return entry.value !== 0;
+          // });
+          const validEntrys = item.match.filter(entry => entry.value !== 0);
+          return validEntrys.length >= 2 && validEntrys.findIndex(entry => entry.key.startsWith('ior_wm') || entry.key.startsWith('ior_mn')) !== -1;
         }
       });
 

+ 1 - 1
server/triangle/totalProfitCalc.js

@@ -140,7 +140,7 @@ const HandicapCalc = function (data) {
         () => {
           const x = g;
           const z = (t + k2 * x / 2) / k5;
-          const y = ((k5 + k6) * t + (k2 * k5 + k2 * k4 / 2) * x) / (k3 * k5);
+          const y = ((k5 + k6) * t + (k5 + k6 / 2) * k2 * x) / (k3 * k5);
           return { x, y, z };
         },
         () => {

+ 1 - 0
server/triangle/trangleCalc.js

@@ -39,6 +39,7 @@ const getOptimalSelections = (odds, rules) => {
             v: item.ps.v,
             r: item.ps.r,
             s: item.ps.s,
+            q: item.ps.q,
             o: item
           }]);
         }

+ 47 - 47
web/apps/web-antd/src/views/match/components/solution_item.vue

@@ -35,30 +35,30 @@ const emit = defineEmits(['toggle']);
 
 const selectedIndex = ref(0);
 
-// const PS_IOR_KEYS = [
-//   ['0', 'ior_mh', 'ior_mn', 'ior_mc'],
-//   ['-1', 'ior_rh_15', 'ior_wmh_1', 'ior_rac_05'],
-//   ['-2', 'ior_rh_25', 'ior_wmh_2', 'ior_rac_15'],
-//   ['-3', 'ior_rh_35', 'ior_wmh_3', 'ior_rac_25'],
-//   // ['-4', 'ior_rh_45', 'ior_wmh_4', 'ior_rac_35'],
-//   // ['-5', 'ior_rh_55', 'ior_wmh_5', 'ior_rac_45'],
-//   ['+1', 'ior_rah_05', 'ior_wmc_1', 'ior_rc_15'],
-//   ['+2', 'ior_rah_15', 'ior_wmc_2', 'ior_rc_25'],
-//   ['+3', 'ior_rah_25', 'ior_wmc_3', 'ior_rc_35'],
-//   // ['+4', 'ior_rah_35', 'ior_wmc_4', 'ior_rc_45'],
-//   // ['+5', 'ior_rah_45', 'ior_wmc_5', 'ior_rc_55'],
-//   ['ou_05', 'ior_ouc_05', '-', 'ior_ouh_05'],
-//   ['ou_15', 'ior_ouc_15', '-', 'ior_ouh_15'],
-//   ['ou_25', 'ior_ouc_25', '-', 'ior_ouh_25'],
-//   ['ou_35', 'ior_ouc_35', '-', 'ior_ouh_35'],
-//   ['ot_1', '-', 'ior_ot_1', '-'],
-//   ['ot_2', '-', 'ior_ot_2', '-'],
-//   ['ot_3', '-', 'ior_ot_3', '-'],
-//   ['ot_4', '-', 'ior_ot_4', '-'],
-//   ['ot_5', '-', 'ior_ot_5', '-'],
-//   // ['ot_6', '-', 'ior_ot_6', '-'],
-//   // ['ot_7', '-', 'ior_ot_7', '-'],
-// ];
+const PS_IOR_KEYS = [
+  ['0', 'ior_mh', 'ior_mn', 'ior_mc'],
+  ['-1', 'ior_rh_15', 'ior_wmh_1', 'ior_rac_05'],
+  ['-2', 'ior_rh_25', 'ior_wmh_2', 'ior_rac_15'],
+  ['-3', 'ior_rh_35', 'ior_wmh_3', 'ior_rac_25'],
+  // ['-4', 'ior_rh_45', 'ior_wmh_4', 'ior_rac_35'],
+  // ['-5', 'ior_rh_55', 'ior_wmh_5', 'ior_rac_45'],
+  ['+1', 'ior_rah_05', 'ior_wmc_1', 'ior_rc_15'],
+  ['+2', 'ior_rah_15', 'ior_wmc_2', 'ior_rc_25'],
+  ['+3', 'ior_rah_25', 'ior_wmc_3', 'ior_rc_35'],
+  // ['+4', 'ior_rah_35', 'ior_wmc_4', 'ior_rc_45'],
+  // ['+5', 'ior_rah_45', 'ior_wmc_5', 'ior_rc_55'],
+  ['ou_05', 'ior_ouc_05', '-', 'ior_ouh_05'],
+  ['ou_15', 'ior_ouc_15', '-', 'ior_ouh_15'],
+  ['ou_25', 'ior_ouc_25', '-', 'ior_ouh_25'],
+  ['ou_35', 'ior_ouc_35', '-', 'ior_ouh_35'],
+  ['ot_1', '-', 'ior_ot_1', '-'],
+  ['ot_2', '-', 'ior_ot_2', '-'],
+  ['ot_3', '-', 'ior_ot_3', '-'],
+  ['ot_4', '-', 'ior_ot_4', '-'],
+  ['ot_5', '-', 'ior_ot_5', '-'],
+  // ['ot_6', '-', 'ior_ot_6', '-'],
+  // ['ot_7', '-', 'ior_ot_7', '-'],
+];
 
 const fixFloat = (number, x = 2) => {
   return parseFloat(number.toFixed(x));
@@ -103,27 +103,27 @@ const parseIorKey = (iorKey) => {
   return { type, side, ratio };
 }
 
-// const formatPsEvents = (events) => {
-//   return PS_IOR_KEYS.map(([label, ...keys]) => {
-//     const labelParts = label.split('_');
-//     const labelType = labelParts[0];
-//     if (labelType === 'ou') {
-//       const labelRatio = parseRatio(labelParts[1]);
-//       label = `ou_${labelRatio}`;
-//     }
-//     const match = keys.map(key => ({
-//       key,
-//       value: events[key]?.v ?? 0,
-//       origin: events[key]?.r
-//     }));
-//     return {
-//       label,
-//       match
-//     };
-//   })
-//   // .filter(item => item.match.every(entry => entry.value !== 0))
-//   .map(({label, match}) => [label, ...match]);
-// }
+const formatPsEvents = (events) => {
+  return PS_IOR_KEYS.map(([label, ...keys]) => {
+    const labelParts = label.split('_');
+    const labelType = labelParts[0];
+    if (labelType === 'ou') {
+      const labelRatio = parseRatio(labelParts[1]);
+      label = `ou_${labelRatio}`;
+    }
+    const match = keys.map(key => ({
+      key,
+      value: events[key]?.v ?? 0,
+      origin: events[key]?.r
+    }));
+    return {
+      label,
+      match
+    };
+  })
+  // .filter(item => item.match.every(entry => entry.value !== 0))
+  .map(({label, match}) => [label, ...match]);
+}
 
 const formatEvents = (events) => {
   const eventsMap = {};
@@ -253,8 +253,8 @@ const currentRelation = computed(() => {
       relation.rel = {};
     }
     const mergedEvents = { ...events, ...special };
-    // const formattedEvents = platform === 'ps' ? formatPsEvents(mergedEvents) : formatEvents(mergedEvents);
-    const formattedEvents = formatEvents(mergedEvents);
+    const formattedEvents = platform === 'ps' ? formatPsEvents(mergedEvents) : formatEvents(mergedEvents);
+    // const formattedEvents = formatEvents(mergedEvents);
     relation.rel[platform] = {
       eventId: eventId ?? 0,
       teamHomeName: teamHomeName ?? '主队',