|
|
@@ -123,28 +123,24 @@ export const eventsCombination = (passableEvents) => {
|
|
|
optimalSelections.forEach(selection => {
|
|
|
const { iors, rule, ruleIndex } = selection;
|
|
|
const [, , , crossType] = rule;
|
|
|
- const [ oddsSideA, oddsSideB, oddsSideC ] = iors;
|
|
|
const baseIndex = iors.reduce((minIdx, cur, idx) => cur.v < iors[minIdx].v ? idx : minIdx, 0);
|
|
|
- if (!oddsSideA || !oddsSideB || !oddsSideC) {
|
|
|
+ if (iors.some(item => !item?.v || item.v <= 0)) {
|
|
|
return;
|
|
|
}
|
|
|
- if (oddsSideA.v <= 1 || oddsSideB.v <= 1) {
|
|
|
- return;
|
|
|
- }
|
|
|
- const cpr = [oddsSideA, oddsSideB, oddsSideC];
|
|
|
+ const cpr = [...iors];
|
|
|
const betInfo = {
|
|
|
cross_type: crossType,
|
|
|
base_index: baseIndex,
|
|
|
base_stake: 10000,
|
|
|
- odds_side_a: fixFloat(oddsSideA.v - 1),
|
|
|
- odds_side_b: fixFloat(oddsSideB.v - 1),
|
|
|
- odds_side_c: fixFloat(oddsSideC.v - 1),
|
|
|
- rebate_side_a: fixFloat(((oddsSideA.b ?? 0) / 100), 4),
|
|
|
- rebate_side_b: fixFloat(((oddsSideB.b ?? 0) / 100), 4),
|
|
|
- rebate_side_c: fixFloat(((oddsSideC.b ?? 0) / 100), 4),
|
|
|
- rebate_type_side_a: oddsSideA.t ?? 0,
|
|
|
- rebate_type_side_b: oddsSideB.t ?? 0,
|
|
|
- rebate_type_side_c: oddsSideC.t ?? 0,
|
|
|
+ odds_side_a: fixFloat(iors[0].v - 1),
|
|
|
+ odds_side_b: fixFloat(iors[1].v - 1),
|
|
|
+ odds_side_c: fixFloat(iors[2].v - 1),
|
|
|
+ rebate_side_a: fixFloat(((iors[0].b ?? 0) / 100), 4),
|
|
|
+ rebate_side_b: fixFloat(((iors[1].b ?? 0) / 100), 4),
|
|
|
+ rebate_side_c: fixFloat(((iors[2].b ?? 0) / 100), 4),
|
|
|
+ rebate_type_side_a: iors[0].t ?? 0,
|
|
|
+ rebate_type_side_b: iors[1].t ?? 0,
|
|
|
+ rebate_type_side_c: iors[2].t ?? 0,
|
|
|
};
|
|
|
const sol = eventSolutions(betInfo, true);
|
|
|
if (cpr[2].k == '-') {
|