תבנית:QueryGamesTemplate: הבדלים בין גרסאות בדף
מתוך מכביפדיה
אין תקציר עריכה
(Allow to search by player position)
שורה 18: שורה 18:


We use the hacky way of concating all player related params in order to "turn on" the check for Team=1,
We use the hacky way of concating all player related params in order to "turn on" the check for Team=1,
There are some games without any maccabi players, we dont want to avoid querying them if we can avoid it (means we search for the game data and not players data).
There are some games without any maccabi players, we don't want to avoid querying them if we can avoid it (means we search for the game data and not players data).
-->{{#cargo_query:
-->{{#cargo_query:
tables=Games_Catalog, Competitions_Catalog, Games_Results, Games_Events, Games_Events=Events2, Days_In_Week, Games_Videos, Football_Games_Uniforms, Opponents
tables=Games_Catalog, Competitions_Catalog, Games_Results, Games_Events, Games_Events=Events2, Days_In_Week, Games_Videos, Football_Games_Uniforms, Opponents, Profiles, Players_Positions
|join on=Games_Catalog.Competition = Competitions_Catalog.CompID
|join on=Games_Catalog.Competition = Competitions_Catalog.CompID
         ,Games_Catalog.ResultOpt = Games_Results.ResultType
         ,Games_Catalog.ResultOpt = Games_Results.ResultType
שורה 29: שורה 29:
         ,Games_Catalog._pageID = Football_Games_Uniforms._pageID
         ,Games_Catalog._pageID = Football_Games_Uniforms._pageID
         ,Games_Catalog.Opponent = Opponents.OriginalName
         ,Games_Catalog.Opponent = Opponents.OriginalName
        ,Games_Events.PlayerName = Profiles._pageName
        ,Players_Positions.PositionType = Profiles.Position
|where=1=1
|where=1=1
{{#if: {{{Player|}}}{{{PlayerNumber|}}}{{{PlayerAction|}}}{{{PlayerActionMinute|}}}{{{PlayerSubAction|}}}{{{PlayerSubActionMinute|}}}| And Games_Events.Team = 1}}
{{#if: {{{Player|}}}{{{PlayerNumber|}}}{{{PlayerAction|}}}{{{PlayerActionMinute|}}}{{{PlayerSubAction|}}}{{{PlayerSubActionMinute|}}}{{{PlayerPosition|}}}| And Games_Events.Team = 1}}
{{#if: {{{Player2|}}}{{{PlayerNumber2|}}}{{{PlayerAction2|}}}{{{PlayerActionMinute2|}}}{{{PlayerSubAction2|}}}{{{PlayerSubActionMinute2|}}}| And Events2.Team = 1}}
{{#if: {{{Player2|}}}{{{PlayerNumber2|}}}{{{PlayerAction2|}}}{{{PlayerActionMinute2|}}}{{{PlayerSubAction2|}}}{{{PlayerSubActionMinute2|}}}{{{PlayerPosition2|}}}| And Events2.Team = 1}}


{{#if: {{{Competition|}}} |  AND Games_Catalog.Competition IN ({{#var: SameCompetitions}}) }}<!-- the "()" around the SameCompetition required for "IN" operator -->
{{#if: {{{Competition|}}} |  AND Games_Catalog.Competition IN ({{#var: SameCompetitions}}) }}<!-- the "()" around the SameCompetition required for "IN" operator -->
שורה 57: שורה 59:
{{#if: {{{PlayerSubAction|}}} | AND Games_Events.SubType IN ({{#var: PlayerSubEvent}}) }}
{{#if: {{{PlayerSubAction|}}} | AND Games_Events.SubType IN ({{#var: PlayerSubEvent}}) }}
{{#if: {{{PlayerSubActionMinute|}}} | AND Games_Events.Minute = {{{PlayerSubActionMinute}}} }}
{{#if: {{{PlayerSubActionMinute|}}} | AND Games_Events.Minute = {{{PlayerSubActionMinute}}} }}
{{#if: {{{PlayerPosition|}}} | AND Players_Positions.PositionString = {{{PlayerPosition}}} }}
{{#if: {{{Player2|}}} |  AND Events2.PlayerName= "{{{Player2}}}" }}
{{#if: {{{Player2|}}} |  AND Events2.PlayerName= "{{{Player2}}}" }}
{{#if: {{{PlayerNumber2|}}} |  AND Events2.PlayerNumber= {{{PlayerNumber2}}} }}
{{#if: {{{PlayerNumber2|}}} |  AND Events2.PlayerNumber= {{{PlayerNumber2}}} }}
שורה 63: שורה 67:
{{#if: {{{PlayerSubAction2|}}} | AND Events2.SubType IN ({{#var: PlayerSubEvent2}}) }}
{{#if: {{{PlayerSubAction2|}}} | AND Events2.SubType IN ({{#var: PlayerSubEvent2}}) }}
{{#if: {{{PlayerSubActionMinute2|}}} | AND Events2.Minute = {{{PlayerSubActionMinute2}}} }}
{{#if: {{{PlayerSubActionMinute2|}}} | AND Events2.Minute = {{{PlayerSubActionMinute2}}} }}
{{#if: {{{PlayerPosition2|}}} | AND Players_Positions.PositionString = {{{PlayerPosition2}}} }}


{{#ifeq: {{{PlayersEventsInSameMinute|}}}| כן| AND Events2.Minute = Games_Events.Minute }}
{{#ifeq: {{{PlayersEventsInSameMinute|}}}| כן| AND Events2.Minute = Games_Events.Minute }}

גרסה מ־17:51, 8 באפריל 2022

לינק לעמוד לחיפוש משחקים

ערכו את הדף כדי לצפות בטקסט התבנית.