Commit 86e0dc51 authored by 郑磊's avatar 郑磊

更新核心代码

parent a005bb69
......@@ -29,6 +29,10 @@ export function oddTypeText(type: OddType) {
return '主胜'
case 'win2':
return '客胜'
case 'btts_yes':
return '双方有进球'
case 'btts_no':
return '双方无进球'
}
}
......@@ -42,11 +46,14 @@ export function varietyText(variety: Variety) {
}
export function conditionText(condition: string | number, type: OddType) {
if (type === 'win1' || type === 'win2' || type === 'draw') return ''
if (type === 'over' || type === 'under') {
return Number(condition).toString()
} else {
}
if (type === 'ah1' || type === 'ah2') {
const symbol = Decimal(condition).gt(0) ? '+' : ''
return `${symbol}${Number(condition)}`
}
return ''
}
......@@ -40,6 +40,14 @@ export function getProfit({
result_value = compareScore(condition, score1 + score2)
} else if (type === 'draw') {
result_value = score1 === score2 ? '1' : '-1'
} else if (type === 'win1') {
result_value = score1 > score2 ? '1' : '-1'
} else if (type === 'win2') {
result_value = score1 < score2 ? '1' : '-1'
} else if (type === 'btts_yes') {
result_value = score1 > 0 && score2 > 0 ? '1' : '-1'
} else if (type === 'btts_no') {
result_value = score1 == 0 && score2 == 0 ? '1' : '-1'
} else {
return '0'
}
......
......@@ -24,7 +24,7 @@
"@types/ball-predict-ai@git+http://gitlab.3yakj.com/ball/types.git":
version "1.0.0"
resolved "git+http://gitlab.3yakj.com/ball/types.git#4600012537894131b9584a5f8aa5bba72e5e3d5b"
resolved "git+http://gitlab.3yakj.com/ball/types.git#9e3d5f9937a2bedfd638b11d4bebace212c8e741"
"@types/lodash-es@^4.17.12":
version "4.17.12"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment