function getOddsFh(fixtureId, thn, tan) { getData('fixtures/' + fixtureId + '/analysis/odds/fh', null, (data) => { // console.log(data); if (!data?.odds?.length) { return; } const odds = data?.odds; const teams = { 'home': [], 'away': [] }; const teamTypes = ['home', 'away']; for (const i in odds) { const o = odds[i]; teams[o.team].push(o); } html = ``; html += `
`; html += `
`; html += `
`; html += `

${thn}

`; html += `
`; html += `

ครึ่ง/เต็มรอบ

`; html += `
`; html += `

${tan}

`; html += `
`; for (const i in teamTypes) { const team = teamTypes[i]; const os = teams[team]; html += `
`; html += ``; html += ``; html += ``; if (team == 'home') { html += ``; } else { html += ``; } html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; for (const k in os) { const o = os[k]; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; } html += ``; html += `
ครึ่งWWWDDDLLL
เต็มรอบWDLWDLWDL
${o.name}${o.ww}${o.wd}${o.wl}${o.dw}${o.dd}${o.dl}${o.lw}${o.ld}${o.ll}
`; html += `
`; } html += `
`; html += `
`; $('#oddsFullHalfSection').html(html); }, (error) => { console.log(error); }); }