Update api_products.class.php
This commit is contained in:
parent
334224cd2d
commit
a6f6db6b54
@ -934,7 +934,7 @@ class Products extends DolibarrApi
|
||||
$tmp->rang = $result->rang;
|
||||
$tmp->entity = $result->entity;
|
||||
|
||||
$return[] = $tmp;
|
||||
$return[] = $this->_cleanObjectDatas($tmp);
|
||||
}
|
||||
|
||||
if (!count($return)) {
|
||||
@ -980,7 +980,7 @@ class Products extends DolibarrApi
|
||||
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."product_attribute_combination2val as pac2v";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."product_attribute_combination as pac ON pac2v.fk_prod_combination = pac.rowid";
|
||||
$sql .= " WHERE pac2v.fk_prod_attr = ".((int) $prodattr->id)." AND pac.entity IN (".getEntity('product').")";
|
||||
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$prodattr->is_used_by_products = (int) $obj->nb;
|
||||
@ -1026,7 +1026,7 @@ class Products extends DolibarrApi
|
||||
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."product_attribute_combination2val as pac2v";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."product_attribute_combination as pac ON pac2v.fk_prod_combination = pac.rowid";
|
||||
$sql .= " WHERE pac2v.fk_prod_attr = ".((int) $result->rowid)." AND pac.entity IN (".getEntity('product').")";
|
||||
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user