sportsmanagementModelRosteralltime::getTeamPlayers 432
SELECT pr.firstname,pr.nickname,pr.lastname,pr.country,pr.birthday,pr.deathday,pr.id AS pid,pr.id AS person_id,pr.picture AS ppic,pr.suspension AS suspension,pr.away AS away,pr.injury AS injury,pr.picture AS ppic,CONCAT_WS(':',pr.id,pr.alias) AS person_slug,tp.id AS playerid,tp.id AS season_team_person_id,tp.jerseynumber AS position_number,tp.notes AS description,tp.market_value AS market_value,tp.market_text AS market_text,tp.picture,st.id AS season_team_id,pt.project_id AS project_id,pos.name AS position,ppos.position_id,ppos.id as pposid,CONCAT_WS(':',pro.id,pro.alias) AS project_slug,CONCAT_WS(':',t.id,t.alias) AS team_slug
FROM z2o57_sportsmanagement_season_team_person_id AS tp
INNER JOIN z2o57_sportsmanagement_season_team_id AS st ON st.team_id = tp.team_id and st.season_id = tp.season_id
INNER JOIN z2o57_sportsmanagement_project_team AS pt ON pt.team_id = st.id
INNER JOIN z2o57_sportsmanagement_person AS pr ON tp.person_id = pr.id
INNER JOIN z2o57_sportsmanagement_project AS pro ON pro.id = pt.project_id and pro.season_id = st.season_id
INNER JOIN z2o57_sportsmanagement_team AS t ON t.id = st.team_id
LEFT JOIN z2o57_sportsmanagement_person_project_position AS perpos ON perpos.project_id = pro.id AND perpos.person_id = pr.id
LEFT JOIN z2o57_sportsmanagement_project_position AS ppos ON ppos.id = perpos.project_position_id
LEFT JOIN z2o57_sportsmanagement_position AS pos ON pos.id = ppos.position_id
WHERE tp.person_id IN ( 562,871,686,822,563,842,890,644,647,692,827,651,632,893,869,813,648,826,567,690,840,689,649,643,694,653,814,662,810,841,660,811,872,867,659,575,576,646,817,639,868,829,825,656,652,635,889,655,815,650,818,875,809,892,808,661,876,687,821,688,636,807,642,685,897,820,691,693,819,637,585,641,633,586,658,812,816,640,638,654,824,888,894,823,695,828,657,645,870,873,634,891 ) AND st.team_id = 3661 AND pr.published = 1 AND tp.published = 1 AND tp.persontype = 1
GROUP BY pr.id
ORDER BY pos.ordering, ppos.position_id, tp.ordering, tp.jerseynumber, pr.lastname, pr.firstname