Updated query and added html for ingredients.
This commit is contained in:
+30
-13
@@ -10,20 +10,31 @@ With this default values are overridden.
|
|||||||
|
|
||||||
```SQL
|
```SQL
|
||||||
SELECT a.name AS product,
|
SELECT a.name AS product,
|
||||||
CONCAT(CONCAT(v.weight, ' '), u.display) AS weight,
|
COALESCE(v.name, a.name) AS name,
|
||||||
a.bio AS bio,
|
CONCAT(CONCAT(v.weight, ' '), u.display) AS weight,
|
||||||
COALESCE(v.description, a.description) AS description,
|
a.bio AS bio,
|
||||||
COALESCE(v.ingredients, a.ingredients) AS ingredients,
|
COALESCE(v.description, a.description) AS description,
|
||||||
COALESCE(v.name, a.name) AS name,
|
CONCAT(COALESCE(v.ingredients, a.ingredients), s.bio_info) AS ingredients,
|
||||||
COALESCE(a.bio_origin, s.bio) AS "bio origin",
|
CONCAT(
|
||||||
COALESCE(a.mhd, s.mhd) AS mhd,
|
CONCAT(
|
||||||
COALESCE(a.allergens_text, s.allergens_text) AS "allergens info"
|
CONCAT(COALESCE(a.bio_origin, s.bio), '<br>'),
|
||||||
|
CASE
|
||||||
|
WHEN a.origin = '1' THEN 'EU-'
|
||||||
|
WHEN a.origin = '2' THEN 'Nicht-EU-'
|
||||||
|
WHEN a.origin = '3' THEN 'EU-/Nicht-EU-'
|
||||||
|
ELSE 'ERROR' END
|
||||||
|
),
|
||||||
|
'Landwirtschaft'
|
||||||
|
) AS "bio",
|
||||||
|
COALESCE(a.mhd, s.mhd) AS mhd,
|
||||||
|
COALESCE(a.allergens_text, s.allergens_text) AS "allergens info"
|
||||||
FROM article AS a
|
FROM article AS a
|
||||||
INNER JOIN variant AS v ON v.article_id = a.id
|
INNER JOIN variant AS v ON v.article_id = a.id
|
||||||
INNER JOIN settings AS s ON v.article_id = v.article_id
|
INNER JOIN settings AS s ON v.article_id = v.article_id
|
||||||
INNER JOIN unit AS u ON v.unit_id = u.id
|
INNER JOIN unit AS u ON v.unit_id = u.id
|
||||||
INNER JOIN label AS l ON v.label_id = l.id
|
INNER JOIN label AS l ON v.label_id = l.id
|
||||||
ORDER BY a.name, v.weight ASC
|
ORDER BY a.name, v.weight ASC
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@@ -38,7 +49,8 @@ ORDER BY a.name, v.weight ASC
|
|||||||
|
|
||||||
### Ingredients
|
### Ingredients
|
||||||
```html
|
```html
|
||||||
|
<html><head><style type='text/css'>body {font-family: Arial; font-size: 7px; text-align: center;}</style></head><body><p style="text-align: center; margin: 0; padding: 0;">
|
||||||
|
</p></body></html>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Allergens info
|
### Allergens info
|
||||||
@@ -46,3 +58,8 @@ ORDER BY a.name, v.weight ASC
|
|||||||
<html><head><style type='text/css'>body {font-family: Arial; font-size: 7px;}</style></head><body><p style="text-align: center; margin: 0; padding: 0;">
|
<html><head><style type='text/css'>body {font-family: Arial; font-size: 7px;}</style></head><body><p style="text-align: center; margin: 0; padding: 0;">
|
||||||
</p></body></html>
|
</p></body></html>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### BIO text
|
||||||
|
```html
|
||||||
|
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user