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

แฮนดิแคปเอเชียย้อนหลังลีกเดียวกัน

`; html += `
`; for (const i in teamTypes) { const team = teamTypes[i]; const ots = oteams[team]; html += `
`; html += ``; html += ``; html += ``; if (team == 'home') { html += ``; } else { html += ``; } html += ``; for (const type in ots) { os = ots[type]; if (type === 'hc') { html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; } else { html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; } for (const k in os) { const o = os[k]; if (o.country_code == '') { html += ``; html += ``; html += ``; continue } html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; } } html += ``; html += `
${thn}${tan}
แข่งเวลาทีมเหย้าแฮนดิแคปทีมเยือนสกอร์AH
แข่งเวลาทีมเหย้าออดชทีมเยือนสกอร์O/U
 
${o.country_code}${moment(o.time).format('DD-MM-YYYY')}${o.team_home}${o.odds}${o.team_away}${o.score}${o.result}
`; html += `
`; } html += `
`; html += `
`; $('#lastOddsHdcSection').html(html); }, (error) => { console.log(error); }); }