most importantly: new category and filter on is_new
This commit is contained in:
@@ -116,7 +116,19 @@ func (repo *ProductsRepo) Find(langID uint, userID uint, p find.Paging, filt *fi
|
||||
p.reference AS reference,
|
||||
COALESCE(v.variants_number, 0) AS variants_number,
|
||||
sa.quantity AS quantity,
|
||||
COALESCE(f.is_favorite, 0) AS is_favorite
|
||||
COALESCE(f.is_favorite, 0) AS is_favorite,
|
||||
CASE
|
||||
WHEN ps.date_add >= DATE_SUB(
|
||||
NOW(),
|
||||
INTERVAL (
|
||||
SELECT value
|
||||
FROM ps_configuration
|
||||
WHERE name = 'PS_NB_DAYS_NEW_PRODUCT'
|
||||
) DAY
|
||||
) AND ps.active = 1
|
||||
THEN 1
|
||||
ELSE 0
|
||||
END AS is_new
|
||||
`, config.Get().Image.ImagePrefix).
|
||||
Joins("JOIN "+dbmodel.PsProductCols.IDProduct.Tab()+" p ON p.id_product = ps.id_product").
|
||||
Joins("JOIN ps_product_lang pl ON pl.id_product = ps.id_product AND pl.id_lang = ?", langID).
|
||||
|
||||
Reference in New Issue
Block a user