Jump to content

blockviewed -不到阵列中重复(一类或品牌)的值。


Nikpro

Recommended Posts

你好
我想创建一个美味的提议给人类。
 
我半路上。
我只离开了没有表现出重复值。
 
此刻,我已经展示了产品的意见的基础上。
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)}

 

 

 
我怎样才能消除值的重复?
post-91213-0-20563900-1467268804_thumb.jpg
 
  1. $c=array();
  2. foreach($a as $b)
  3. {
  4.     if(!in_array($b,$c))
  5.     {
  6.      $c[]=$b;
  7.      echo $b;
  8.     }
  9. }
  10.  
我知道,有一种比较方式。但花后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

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...