public function getNewArticleGroups($lang){\r
if (!$lang){ $lang=$this->cfg["lang"];}\r
$datescount=10;\r
- $sql = "select ag.id, UPPER(ag.article) as article,\r
- ag.gp_art, ag.famille_art,\r
+ $sql = "select ag.id, UPPER(ag.article) as article, ag.gp_art, ag.famille_art,\r
coalesce(ag.titre_".$this->cfg["lang"].", ag.titre_".$this->cfg["lang"].") as titre,\r
coalesce(ag.description_".$this->cfg["lang"].", ag.description_".$this->cfg["lang"].") as description,\r
- ag.c01_label, ag.c02_label, ag.c03_label, ag.c03_label, ag.c04_label, ag.c05_label,\r
- replace(ag.image, ' ', '%20') as image,\r
+ ag.c01_label, ag.c02_label, ag.c03_label, ag.c03_label, ag.c04_label, ag.c05_label, replace(ag.image, ' ', '%20') as image,\r
ag.fichetechnique, ag.brochure, ag.noticemontage, ag.videolink, ad.creationdate\r
- from article_groups ag join ( select article_group,creationdate from articles where isactive=1 group by article_group order by creationdate DESC LIMIT ".$datescount." ) ad on (UPPER(ag.article) = UPPER(ad.article_group)) where ag.isactive = 1 order by ad.creationdate DESC, ag.article;";\r
+ from article_groups ag join ( select article as article_group,creationdate from ( select ag2.article,ar2.creationdate as creationdate from articles ar2 join article_groups ag2 on (ar2.article_group=ag2.article) where ag2.isactive= 1 order by ar2.creationdate DESC) ar3 group by article,creationdate order by creationdate DESC LIMIT ".$datescount." ) ad on (UPPER(ag.article) = UPPER(ad.article_group)) where ag.isactive = 1 order by ad.creationdate DESC, ag.article;";\r
return $this->dbh->queryarray($sql);\r
}\r
\r
if (!$lang){ $lang=$this->cfg["lang"];}\r
$datescount=10;\r
//all articles returned grouped by article_group;\r
- return $this->dbh->querybykey('article_group',"select ar.id, UPPER(ar.article_group) as article_group, UPPER(ar.article) as article, ar.gp_art, ar.famille_art, ar.c01, ar.c02, ar.c03, ar.c04, ar.c05, ap.prix_net, ar.unite_quantite, ar.qte_stock, qte_commandee, ar.doc_ft, ar.doc_mo, ar.doc_fs, ar.videolink,case when ar.creationdate + INTERVAL 1 month > CURRENT_DATE then 1 else null end as isnew from articles ar left join article_prices ap on (ar.article = ap.article) join ( select article_group, creationdate from articles where isactive = 1 group by article_group order by creationdate DESC LIMIT ".$datescount.") ag on (ar.article_group = ag.article_group) where ar.isactive = 1 group by ar.id, ar.article_group, ar.article order by ar.article_group, ar.article;");\r
+ return $this->dbh->querybykey('article_group',"select ar.id, UPPER(ar.article_group) as article_group, UPPER(ar.article) as article, ar.gp_art, ar.famille_art, ar.c01, ar.c02, ar.c03, ar.c04, ar.c05, ap.prix_net, ar.unite_quantite, ar.qte_stock, qte_commandee, ar.doc_ft, ar.doc_mo, ar.doc_fs, ar.videolink,case when ar.creationdate + INTERVAL 1 month > CURRENT_DATE then 1 else null end as isnew from articles ar left join article_prices ap on (ar.article = ap.article) join ( select article as article_group,creationdate from ( select ag2.article,ar2.creationdate as creationdate from articles ar2 join article_groups ag2 on (ar2.article_group=ag2.article) where ag2.isactive= 1 order by ar2.creationdate DESC) ar3 group by article,creationdate order by creationdate DESC LIMIT ".$datescount.") ag on (ar.article_group = ag.article_group) where ar.isactive = 1 group by ar.id, ar.article_group, ar.article order by ar.article_group, ar.article;");\r
}\r
\r
\r