Actions

Template

ResourceCraftedFrom: Difference between revisions

From Dune Awakening DB

Created page with "<includeonly><!-- Template:ResourceCraftedFrom (comma-escaped) --> {{#get_external_data: source = externaldb |from = data_recipe_ingredients JOIN data_recipes ON data_recipe_ingredients.recipe_id = data_recipes.id JOIN data_recipe_stations ON data_recipes.id = data_recipe_stations.recipe_id LEFT JOIN data_recipe_outcomes ON data_recipes.id = data_recipe_outcomes.recipe_id |data = Output..."
 
mNo edit summary
 
Line 1: Line 1:
<includeonly><!-- Template:ResourceCraftedFrom (comma-escaped) -->
<includeonly>
{{#get_external_data:
{{#get_external_data:
   source = externaldb
   source = externaldb
   |from  = data_recipe_ingredients
   |from  = vw_recipe_by_ingredient
          JOIN data_recipes          ON data_recipe_ingredients.recipe_id  = data_recipes.id
   |data  = OutputItem = output_item,
          JOIN data_recipe_stations  ON data_recipes.id                    = data_recipe_stations.recipe_id
           Resources  = resources,
          LEFT JOIN data_recipe_outcomes ON data_recipes.id                = data_recipe_outcomes.recipe_id
           Station    = stations,
   |data  = OutputItem = primary_output_label,
           WaterML    = water_ml,
           Resources  = GROUP_CONCAT(\DISTINCT CONCAT(\ingredient_label\, CHAR(32)\, CHAR(120)\, amount) SEPARATOR CHAR(59)),
           CraftTime  = craft_time,
           Stations  = GROUP_CONCAT(\DISTINCT production_type SEPARATOR CHAR(59)),
           Schematic  = schematic
           WaterML    = water_ml_total,
   |where = ingredient = '{{{resource|Copper Ingot}}}'   <!-- note the quotes -->
           CraftTime  = crafting_time_s,
   |order by = Station
           Schematic  = schematic_requirement
   |where = ingredient_label = {{{resource|{{PAGENAME}}}}}
   |group by = primary_output_label
   |order by = primary_output_label
   |cache = yes
   |cache = yes
}}
}}
Line 23: Line 19:
       <th>Item Created</th>
       <th>Item Created</th>
       <th>Resources Needed</th>
       <th>Resources Needed</th>
       <th>Stations</th>
       <th>Station</th>
       <th>Water&nbsp;(mL)</th>
       <th>Water&nbsp;(mL)</th>
       <th>Craft&nbsp;Time</th>
       <th>Time</th>
       <th>Schematic</th>
       <th>Schematic</th>
     </tr>
     </tr>
   </thead>
   </thead>
   <tbody>
   <tbody>
    {{#for_external_table:|
{{#for_external_table:|
      <tr>
    <tr>
        <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
      <td>{{#invoke:DataTableParserV2|iconize|{{{OutputItem}}}}}</td>
        <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
      <td>{{#invoke:DataTableParserV2|formatRecipeList|{{{Resources}}}}}</td>
        <td>{{{Stations}}}</td>
      <td>{{{Station}}}</td>
        <td>{{{WaterML|0}}}</td>
      <td>{{{WaterML|0}}}</td>
        <td>{{{CraftTime|0}}}&nbsp;sec</td>
      <td>{{{CraftTime|0}}}&nbsp;s</td>
        <td>{{#if:{{{Schematic|}}}|[[{{{Schematic}}}]]|None}}</td>
      <td>{{#if:{{{Schematic|}}}|[[{{{Schematic}}}]]|None}}</td>
      </tr>
    </tr>
    }}
}}
   </tbody>
   </tbody>
</table>
</table>
</includeonly>
</includeonly>

Latest revision as of 22:45, 26 May 2025