|
|
@@ -246,7 +246,11 @@ const updateGamesList = (({ platform, mk, games } = {}) => {
|
|
|
*/
|
|
|
const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
|
|
|
|
- const { expireTimeEvents, expireTimeSpecial, subsidyTime, subsidyAmount } = getSetting();
|
|
|
+ const {
|
|
|
+ expireTimeEvents, expireTimeSpecial,
|
|
|
+ subsidyTime, subsidyAmount,
|
|
|
+ subsidyRbWmAmount, subsidyRbOtAmount
|
|
|
+ } = getSetting();
|
|
|
const nowTime = Date.now();
|
|
|
|
|
|
const marketType = getMarketType(mk);
|
|
|
@@ -261,6 +265,17 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
|
const { eventId, originId, stage, retime, score, wm, evtime, events } = game;
|
|
|
const baseGame = baseMap.get(eventId);
|
|
|
if (baseGame) {
|
|
|
+ const { mk } = baseGame;
|
|
|
+ const isRb = (mk == 2);
|
|
|
+ if (isRb) {
|
|
|
+ Object.keys(events).forEach(ior => {
|
|
|
+ if ((ior.startsWith('ior_r') || ior.startsWith('ior_m')) && subsidyRbWmAmount) {
|
|
|
+ const sourceOdds = events[ior].v;
|
|
|
+ events[ior].v = fixFloat(sourceOdds * (1 + subsidyRbWmAmount), 3);
|
|
|
+ events[ior].s = sourceOdds
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
baseGame.originId = originId;
|
|
|
baseGame.stage = stage;
|
|
|
baseGame.retime = retime;
|
|
|
@@ -275,13 +290,28 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
|
|
|
const { parentId, sptime, special } = outright;
|
|
|
const baseGame = baseMap.get(parentId);
|
|
|
if (baseGame) {
|
|
|
- const { timestamp } = baseGame;
|
|
|
+ const { timestamp, mk } = baseGame;
|
|
|
+ const isRb = (mk == 2);
|
|
|
const isSubsidy = timestamp > nowTime && timestamp < nowTime + 1000*60*60*subsidyTime;
|
|
|
if (isSubsidy) {
|
|
|
Object.keys(special).forEach(ior => {
|
|
|
- if (ior.startsWith('ior_ot')) {
|
|
|
+ if (ior.startsWith('ior_ot') && subsidyAmount) {
|
|
|
const sourceOdds = special[ior].v;
|
|
|
- special[ior].v = fixFloat(sourceOdds * (1 + subsidyAmount));
|
|
|
+ special[ior].v = fixFloat(sourceOdds * (1 + subsidyAmount), 3);
|
|
|
+ special[ior].s = sourceOdds
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else if (isRb) {
|
|
|
+ Object.keys(special).forEach(ior => {
|
|
|
+ if (ior.startsWith('ior_wm') && subsidyRbWmAmount) {
|
|
|
+ const sourceOdds = special[ior].v;
|
|
|
+ special[ior].v = fixFloat(sourceOdds * (1 + subsidyRbWmAmount), 3);
|
|
|
+ special[ior].s = sourceOdds
|
|
|
+ }
|
|
|
+ else if (ior.startsWith('ior_ot') && subsidyRbOtAmount) {
|
|
|
+ const sourceOdds = special[ior].v;
|
|
|
+ special[ior].v = fixFloat(sourceOdds * (1 + subsidyRbOtAmount), 3);
|
|
|
special[ior].s = sourceOdds
|
|
|
}
|
|
|
});
|
|
|
@@ -1070,8 +1100,18 @@ const syncQbossConfig = () => {
|
|
|
throw new Error('syncQbossConfig data is empty');
|
|
|
}
|
|
|
const setting = getSetting();
|
|
|
- const { qboss_return_ratio, qboss_jq_add_odds, qboss_jq_add_hours } = data.data;
|
|
|
- const qbossSetting = { innerRebateRatio: +qboss_return_ratio, subsidyTime: +qboss_jq_add_hours, subsidyAmount: +qboss_jq_add_odds };
|
|
|
+ const {
|
|
|
+ qboss_return_ratio,
|
|
|
+ qboss_jq_add_odds, qboss_jq_add_hours,
|
|
|
+ qboss_gq_add_dy_odds, qboss_gq_add_jq_odds,
|
|
|
+ } = data.data;
|
|
|
+ const qbossSetting = {
|
|
|
+ innerRebateRatio: +qboss_return_ratio,
|
|
|
+ subsidyTime: +qboss_jq_add_hours,
|
|
|
+ subsidyAmount: +qboss_jq_add_odds,
|
|
|
+ subsidyRbWmAmount: +qboss_gq_add_dy_odds,
|
|
|
+ subsidyRbOtAmount: +qboss_gq_add_jq_odds,
|
|
|
+ };
|
|
|
const settingFields = {};
|
|
|
let needUpdate = false;
|
|
|
Object.keys(qbossSetting).forEach(key => {
|