|
@@ -218,7 +218,8 @@ const submitOdds = ({ platform, mk, games }) => {
|
|
|
*/
|
|
*/
|
|
|
const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
|
|
|
|
|
|
- const { expireTimeEvents, expireTimeSpecial } = getSetting();
|
|
|
|
|
|
|
+ const { expireTimeEvents, expireTimeSpecial, subsidyTime, subsidyAmount } = getSetting();
|
|
|
|
|
+ const nowTime = Date.now();
|
|
|
|
|
|
|
|
const marketType = getMarketType(mk);
|
|
const marketType = getMarketType(mk);
|
|
|
const baseList = GAMES.Baselist;
|
|
const baseList = GAMES.Baselist;
|
|
@@ -246,6 +247,17 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
|
const { parentId, sptime, special } = outright;
|
|
const { parentId, sptime, special } = outright;
|
|
|
const baseGame = baseMap.get(parentId);
|
|
const baseGame = baseMap.get(parentId);
|
|
|
if (baseGame) {
|
|
if (baseGame) {
|
|
|
|
|
+ const { timestamp } = baseGame;
|
|
|
|
|
+ const isSubsidy = timestamp > nowTime && timestamp < nowTime + 1000*60*60*subsidyTime;
|
|
|
|
|
+ if (isSubsidy) {
|
|
|
|
|
+ Object.keys(special).forEach(ior => {
|
|
|
|
|
+ if (ior.startsWith('ior_ot')) {
|
|
|
|
|
+ const sourceOdds = special[ior].v;
|
|
|
|
|
+ special[ior].v = fixFloat(sourceOdds + subsidyAmount, 3);
|
|
|
|
|
+ special[ior].s = sourceOdds
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
baseGame.sptime = sptime;
|
|
baseGame.sptime = sptime;
|
|
|
baseGame.special = special;
|
|
baseGame.special = special;
|
|
|
}
|
|
}
|
|
@@ -262,8 +274,8 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
|
if (games?.length) {
|
|
if (games?.length) {
|
|
|
const gamesList = baseList[marketType]?.map(game => {
|
|
const gamesList = baseList[marketType]?.map(game => {
|
|
|
const { evtime, events, sptime, special, ...gameInfo } = game;
|
|
const { evtime, events, sptime, special, ...gameInfo } = game;
|
|
|
- const expireTimeEv = Date.now() - expireTimeEvents;
|
|
|
|
|
- const expireTimeSP = Date.now() - expireTimeSpecial;
|
|
|
|
|
|
|
+ const expireTimeEv = nowTime - expireTimeEvents;
|
|
|
|
|
+ const expireTimeSP = nowTime - expireTimeSpecial;
|
|
|
let odds = {};
|
|
let odds = {};
|
|
|
if (evtime > expireTimeEv) {
|
|
if (evtime > expireTimeEv) {
|
|
|
odds = { ...odds, ...events };
|
|
odds = { ...odds, ...events };
|
|
@@ -276,7 +288,8 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
|
return {
|
|
return {
|
|
|
key,
|
|
key,
|
|
|
value: odds[key]?.v ?? 0,
|
|
value: odds[key]?.v ?? 0,
|
|
|
- origin: odds[key]?.r
|
|
|
|
|
|
|
+ origin: odds[key]?.r,
|
|
|
|
|
+ source: odds[key]?.s,
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
if (label == 'jqs') {
|
|
if (label == 'jqs') {
|