Difference between revisions of "SalesRow/GetLast"

From Sega Retro

Line 2: Line 2:
 
table=salescharts
 
table=salescharts
 
|fields=position,date
 
|fields=position,date
|where=chartname="{{{chartname|{{PAGENAME}}}}}" and gamename="{{{1|}}}" and format="{{{2|unknown}}}" and date < {{#var:currentdate}}
+
|where=chartname="{{{chartname|{{PAGENAME}}}}}" and date < {{#var:currentdate}}
 
|order by=date DESC
 
|order by=date DESC
 
|format=template
 
|format=template
 
|template=SalesRow/GetLast/Cargo
 
|template=SalesRow/GetLast/Cargo
}}{{#vardefine:lastgamedate|{{#var:lastdate}}}}
+
}}
{{#vardefine:realLast|{{#var:last}}}}
+
{{#vardefine:lastchartdate|{{#var:lastdate}}}}
{{#cargo_query:
+
 
 +
{{#vardefine:last|0}}{{#cargo_query:
 
table=salescharts
 
table=salescharts
 
|fields=position,date
 
|fields=position,date
|where=chartname="{{{chartname|{{PAGENAME}}}}}" and date < {{#var:currentdate}}
+
|where=chartname="{{{chartname|{{PAGENAME}}}}}" and gamename="{{{1|}}}" and format="{{{2|unknown}}}" and date < {{#var:currentdate}}
 
|order by=date DESC
 
|order by=date DESC
 
|format=template
 
|format=template
Line 17: Line 18:
 
}}
 
}}
  
{{#ifexpr:{{#var:lastgamedate}} > 0|{{#ifeq:{{#var:lastdate}}|{{#var:lastgamedate}}|{{#vardefine:last|{{#var:realLast}}}}|{{#vardefine:last|re-entry}}}}|}}
+
{{#ifexpr:{{#var:lastchartdate}} > 0|{{#ifeq:{{#var:lastdate}}|{{#var:lastchartdate}}||{{#vardefine:last|re-entry}}}}|}}
 
</div></includeonly><noinclude>
 
</div></includeonly><noinclude>
  

Revision as of 15:57, 4 May 2022





20020600