תבנית:שליפת נתוני משחקים: הבדלים בין גרסאות בדף

מתוך ויקיפועל
קפיצה לניווט קפיצה לחיפוש
אין תקציר עריכה
אין תקציר עריכה
 
(34 גרסאות ביניים של אותו משתמש אינן מוצגות)
שורה 1: שורה 1:
{{#vardefine:fromday|'{{{מיום}}}'}}{{#vardefine:frommonth|'{{{מחודש}}}'}}{{#vardefine:fromyear|'{{{משנה}}}'}}
{{#vardefine:today|'{{{ליום}}}'}}{{#vardefine:tomonth|'{{{לחודש}}}'}}{{#vardefine:toyear|'{{{לשנה}}}'}}
{{#vardefine:whereclause|
{{#vardefine:whereclause|
liga IS NOT NULL AND liga='{{{ליגה}}}'  
liga IS NOT NULL AND liga='{{{ליגה}}}'  
{{#ifexpr:{{#len:{{{מחלקה}}}}} > 0| AND department='{{{מחלקה}}}' | AND department='whatever'}}  
{{#ifexpr:{{#len:{{{מחלקה}}}}} > 0| AND department='{{{מחלקה}}}' | AND department='whatever'}}  
{{#ifeq:{{{תוצאה}}}|(הכל)|| AND result='{{{תוצאה}}}' }}  
{{#ifeq:{{{תוצאה}}}|(הכל)| AND result<>'?' | AND result='{{{תוצאה}}}' }}  
{{#ifeq:{{{ביתיות}}}|(הכל)|| AND homegame='{{{ביתיות}}}' }}  
{{#ifeq:{{{ביתיות}}}|(הכל)|| AND homegame='{{{ביתיות}}}' }}  
{{#ifeq:{{{יריבה}}}|(הכל)|| AND (Games.host="{{החלפת שם יריב שאילתא|יריבה={{{יריבה|}}}}}" OR Games.oponent="{{החלפת שם יריב שאילתא|יריבה={{{יריבה|}}}}}")|}}  
{{#ifeq:{{{יריבה}}}|(הכל)|| AND (Games.host='{{החלפת שם יריב שאילתא|יריבה={{{יריבה|}}}}}' OR Games.oponent='{{החלפת שם יריב שאילתא|יריבה={{{יריבה|}}}}}')|}}  
{{#ifexpr:{{#len:{{{מיום}}}}} > 0| AND (year>'{{{משנה}}}' OR (year='{{{משנה}}}' AND month>'{{{מחודש}}}') OR          (year='{{{משנה}}}' AND month='{{{מחודש}}}' AND day>='{{{מיום}}}'))|}}
{{#ifeq:{{#len:{{{מתאריך}}}}}|10|{{#if: {{{מתאריך|}}} | AND STR_TO_DATE(CONCAT(Games.year,'-',Games.month, '-', Games.day), '%Y-%m-%d') >= '{{{מתאריך}}}' |}}|}}
{{#ifexpr:{{#len:{{{ליום}}}}} > 0| AND (year<'{{{לשנה}}}' OR (year='{{{לשנה}}}' AND month<'{{{לחודש}}}') OR (year='{{{לשנה}}}' AND month='{{{לחודש}}}' AND day<='{{{ליום}}}'))|}}  
{{#ifeq:{{#len:{{{עדתאריך}}}}}|10|{{#if: {{{עדתאריך|}}} | AND  STR_TO_DATE(CONCAT(Games.year,'-',Games.month, '-', Games.day), '%Y-%m-%d') <= '{{{עדתאריך}}}' |}}|}}
{{#ifeq:{{{מפעל}}}|(הכל)| AND liga='{{{ליגה}}}' {{#ifeq:{{{ליגה}}}|1|GROUP BY liga|GROUP BY MIFAL}}|{{#ifeq:{{{מפעל}}}|ליגה| AND liga='1' GROUP BY liga | AND mifal="{{{מפעל}}}" GROUP BY mifal }} }}
{{#ifeq:{{{מפעל}}}|(הכל)| AND liga='{{{ליגה}}}' {{#ifeq:{{{ליגה}}}|1|GROUP BY liga|GROUP BY MIFAL}}|{{#ifeq:{{{מפעל}}}|ליגה| AND liga='1' GROUP BY liga | AND mifal='{{#replace:{{{מפעל}}}|&#39;|\'}}' GROUP BY mifal }} }}
}}{{#cargo_query:
}}{{#cargo_query:
tables=Games
tables=Games
|fields=CONCAT(case liga when '1' then 'ליגה' else mifal end),COUNT(*),SUM(case result when '1' then 1 else 0 end),SUM(case result when 'x' then 1 else 0 end),SUM(case result when '0' then 1 else 0 end),SUM(case host when 'הפועל ת"א' then homescore  else 0 end)+SUM(case oponent when 'הפועל ת"א' then awayscore else 0 end),SUM(case host when 'הפועל ת"א' then awayscore  else 0 end)+SUM(case oponent when 'הפועל ת"א' then homescore else 0 end),department,{{#var:fromday}}=fromday,{{#var:frommonth}}=frommonth,{{#var:fromyear}}=fromyear,{{#var:today}}=today,{{#var:tomonth}}=tomonth,{{#var:toyear}}=toyear,'{{#replace:{{{יריבה}}}|.|#}}'=against
|fields=CONCAT(case liga when '1' then 'ליגה' else mifal end),COUNT(*),SUM(case result when '1' then 1 else 0 end),SUM(case result when 'x' then 1 else 0 end),SUM(case result when '0' then 1 else 0 end),SUM(case host when 'הפועל ת"א' then homescore  else 0 end)+SUM(case oponent when 'הפועל ת"א' then awayscore else 0 end),SUM(case host when 'הפועל ת"א' then awayscore  else 0 end)+SUM(case oponent when 'הפועל ת"א' then homescore else 0 end),department,day,month,year,'{{#replace:{{{יריבה}}}|.|#}}'=against
|where={{#var:whereclause}}
|where={{#var:whereclause}}
|format=template
|format=template

גרסה אחרונה מ־06:02, 11 בנובמבר 2023