Ver código fonte

过滤低赔率策略

flyzto 1 mês atrás
pai
commit
2fdfc9799e

+ 10 - 4
server/models/GamesPs.js

@@ -961,7 +961,7 @@ const updateSolutions = (solutions, eventsLogsMap) => {
 /**
  * 获取中单方案
  */
-const getSolutions = async ({ win_min, with_events, mk=-1 }) => {
+const getSolutions = async ({ win_min, with_events, show_lower=false, mk=-1 }) => {
   // Logs.out('getSolutions', win_min);
   const filterMarketType = +mk;
   const { minShowAmount } = getSetting();
@@ -977,7 +977,10 @@ const getSolutions = async ({ win_min, with_events, mk=-1 }) => {
   }
 
   let solutions = solutionsList.filter(item => {
-    const { sol: { win_average } } = item;
+    const { sol: { win_average }, lower } = item;
+    if (!show_lower && lower) {
+      return false;
+    }
     return win_average >= (win_min ?? minShowAmount);
   })
   .map(item => {
@@ -1012,7 +1015,7 @@ const getSolutions = async ({ win_min, with_events, mk=-1 }) => {
 /**
  * 获取中单方案并按照比赛分组
  */
-const getGamesSolutions = async ({ win_min, with_events, mk=-1, tp=0, sk }) => {
+const getGamesSolutions = async ({ win_min, with_events, show_lower=false, mk=-1, tp=0, sk }) => {
 
   const filterMarketType = +mk;
   const filterDataType = +tp;
@@ -1032,8 +1035,11 @@ const getGamesSolutions = async ({ win_min, with_events, mk=-1, tp=0, sk }) => {
 
   solutionsList.forEach(item => {
     const { info: { id }, ...solution } = item;
-    const { rule, sol: { win_average } } = solution;
+    const { rule, sol: { win_average }, lower } = solution;
     const ruleType = getRuleType(rule);
+    if (!show_lower && lower) {
+      return false;
+    }
     if ((filterDataType == 0 || filterDataType == ruleType) && (!!sk || win_average >= (win_min ?? minShowAmount))) {
       const gameRelation = relationsMap.get(id);
       if (!solutionsMap[id]) {

+ 2 - 0
server/routes/pstery.js

@@ -100,6 +100,7 @@ router.get('/get_solutions', (req, res) => {
   Games.getSolutions({
     win_min: win_min ? +win_min : undefined,
     with_events: with_events === 'true',
+    show_lower: show_lower === 'true',
     mk: mk ? +mk : -1
   })
   .then(({ solutions, gamesEvents, mkCount }) => {
@@ -116,6 +117,7 @@ router.get('/get_games_solutions', (req, res) => {
   Games.getGamesSolutions({
     win_min: win_min ? +win_min : undefined,
     with_events: with_events === 'true',
+    show_lower: show_lower === 'true',
     mk: mk ? +mk : -1,
     tp: tp ? +tp : 0,
     sk: sk.trim() ? sk.trim() : undefined,

+ 2 - 1
server/triangle/trangleCalc.js

@@ -228,11 +228,12 @@ const eventsCombination = (passableEvents) => {
           // Logs.outDev('keys', `${id}##${keys}`)
           const sid = crypto.createHash('sha1').update(`${id}-${keys}`).digest('hex');
           const crpGroup = `${id}_${cpr.find(item => item.p == 'ps').k}`;
+          const hasLower = cpr.some(item => !item.q);
           // Logs.outDev('crpGroup', crpGroup)
           const platformKey = getPlatformKey(cpr);
           // Logs.outDev('platformKey', platformKey, cpr)
           const timestamp = Date.now();
-          solutions.push({sid, sol, cpr, cross: platformKey, info, group: crpGroup, rule: `${iorGroup}:${ruleIndex}`, timestamp});
+          solutions.push({sid, sol, cpr, cross: platformKey, info, group: crpGroup, lower: hasLower, rule: `${iorGroup}:${ruleIndex}`, timestamp});
         }
       });
     });

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

@@ -55,7 +55,8 @@ const getSolutions = async () => {
     const sk = searchValue.value.trim();
     const win_min = !!sk ? -99999 : minProfitRate.value * 100;
     const with_events = true;
-    const data = await requestClient.get('/pstery/get_games_solutions', { params: { win_min, mk, tp, sk, with_events } });
+    const show_lower = true;
+    const data = await requestClient.get('/pstery/get_games_solutions', { params: { win_min, mk, tp, sk, with_events, show_lower } });
     return data;
   }
   catch (error) {