Nikpro Posted June 30, 2016 Share Posted June 30, 2016 你好 我想创建一个美味的提议给人类。 我半路上。 我只离开了没有表现出重复值。 此刻,我已经展示了产品的意见的基础上。 1.分类 2.制造商 但现在,他们都反复 我说行266 $ Obj-> id_manufacturer = (int) ($ productsImagesArray [$ productViewed] [ 'id_manufacturer']); $ Obj-> id_category_default = (int) ($ productsImagesArray [$ productViewed] [ 'id_category_default']); 并呼吁基地 SELECT MAX(image_shop.id_image) id_image, p.id_product, il.legend, product_shop.active, pl.name, p.id_manufacturer, p.id_category_default, m.name AS manufacturer_name, in tpl {$link->getCategoryLink($viewedProduct->id_category_default)} 我怎样才能消除值的重复? $c=array(); foreach($a as $b) { if(!in_array($b,$c)) { $c[]=$b; echo $b; } } 我知道,有一种比较方式。但花后2天我没能找到一个解决方案((( if (is_array($obj->id_manufacturer) && count($obj->id_manufacturer)) { foreach ($obj->id_manufacturer as $key => $obj->id_manufacturer) { if ($productsImagesArray[$productViewed]['id_manufacturer'] == $obj->id_manufacturer) { unset($obj->id_manufacturers[$key]); } } } ; Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted July 1, 2017 Share Posted July 1, 2017 你看看你的数据库查询语句结果,后面加一个 group by 就可以吧, Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now