function getStanding() { getData('fixtures/' + fixtureId + '/analysis/standing', null, (data) => { // console.log(data); if (!data?.list?.length) { return; } const teams = {}; for (const k in data.labels) { const value = data.labels[k]; teams[value.team] = { label: value.name, data: [], }; } for (const k in data.list) { const value = data.list[k]; if(!teams[value.team]){ teams[value.team] = { label: value.name, data: [], }; } teams[value.team]['data'].push(value); } const cls = { 'ทีมเหย้า': 'text-team-home', 'ทีมเยือน': 'text-team-away', }; let html = `

ตารางคะแนน

`; html += `
`; if (teams.other?.data?.length) { html += `
`; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; for (const key in teams.other.data) { const item = teams.other.data[key]; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; } html += ``; html += `
อันดับทีมนัดชนะเสมอแพ้ได้เสียแต้ม
${item.rank}${item.team_name}${item.gp}${item.w}${item.d}${item.l}${item.gf}${item.ga}${item.p}
`; html += `
`; } for (const key in teams) { if (key === 'home' || key === 'away') { const team = teams[key]; html += `
`; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; for (const key2 in team.data) { const item = team.data[key2]; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; html += ``; } html += ``; html += `
`; html += `${team['label'] ?? ''}`; html += `
เต็มรอบนัดชนะเสมอแพ้ได้เสียแต้มอันดับRate
${item.type}${item.gp}${item.w}${item.d}${item.l}${item.gf}${item.ga}${item.p}${item.rank}${item.rate}
`; html += `
`; } } html += `
`; // console.log(html); $('#standingSection').html(html); }, (error) => { console.log(error); }); }