flyzto il y a 6 mois
Parent
commit
6e386c1870

+ 5 - 3
server/models/Games.js

@@ -400,13 +400,15 @@ const solutionsCleanup = () => {
 }
 
 const getTotalProfit = (sid1, sid2, gold_side_jc) => {
-  const sol1 = GAMES.Solutions[sid1]?.sol;
-  const sol2 = GAMES.Solutions[sid2]?.sol;
+  const preSolution = GAMES.Solutions[sid1];
+  const subSolution = GAMES.Solutions[sid2];
+  const sol1 = preSolution?.sol;
+  const sol2 = subSolution?.sol;
   if (!sol1 || !sol2 || !gold_side_jc) {
     return {};
   }
   const profit = calcTotalProfit(sol1, sol2, gold_side_jc);
-  return { profit, sol1, sol2 };
+  return { profit, preSolution, subSolution };
 }
 
 const getSetting = async () => {

+ 3 - 3
server/triangle/eventsMatch.js

@@ -90,8 +90,8 @@ const getGamesRelation = () => {
 //   });
 // }
 
-const setSolution = (solutions) => {
-  postDataToParent('setSolution', solutions);
+const setSolutions = (solutions) => {
+  postDataToParent('setSolutions', solutions);
 }
 
 const extractOdds = ({ evtime, events, sptime, special }) => {
@@ -174,7 +174,7 @@ const eventMatch = () => {
     });
 
     const solutions = eventsCombination(passableEvents, SETTING);
-    setSolution(solutions);
+    setSolutions(solutions);
   })
   .finally(() => {
     setTimeout(() => {

+ 7 - 3
server/triangle/trangleCalc.js

@@ -217,10 +217,14 @@ const eventSolutions = (oddsInfo, oddsOption) => {
     return;
   }
   const profitInfo = triangleProfitCalc(goldsInfo, oddsOption);
-  // console.log(goldsInfo, profitInfo);
+
+  const { odds_side_a, odds_side_b, odds_side_m } = goldsInfo;
+  const { win_average } = profitInfo;
   return {
-    ...goldsInfo,
-    ...profitInfo,
+    odds_side_a,
+    odds_side_b,
+    odds_side_m,
+    win_average,
     cross_type: oddsOption.crossType,
     jc_index: oddsOption.jcIndex,
     jc_base: innerDefaultAmount,

+ 2 - 2
web/apps/web-antd/src/views/match/solutions/index.vue

@@ -35,9 +35,9 @@ const headerStyle = computed(() => {
 });
 
 const totalProfitValue = computed(() => {
-  const { profit, sol1, sol2 } = totalProfit.value;
+  const { profit = {}, sol1 = {}, sol2 = {} } = totalProfit.value;
   const profitInfo = {};
-  const jcScale = jcOptions.bet / profit.jc_base;
+  const jcScale = jcOptions.bet / profit.jc_base ?? 10000;
   const jcRebate = jcOptions.bet * jcOptions.rebate / 100;
 
   Object.keys(profit).forEach(key => {