|
@@ -1057,12 +1057,16 @@ class ProductCombinationLevel
|
|
|
*/
|
|
|
public function fetch($rowid)
|
|
|
{
|
|
|
- $sql = "SELECT rowid, fk_product_attribute_combination, fk_price_level, variation_price, variation_price_percentage FROM ".MAIN_DB_PREFIX.$this->table_element." WHERE rowid = ".(int) $rowid;
|
|
|
-
|
|
|
- $obj = $this->db->getRow($sql);
|
|
|
+ $sql = "SELECT rowid, fk_product_attribute_combination, fk_price_level, variation_price, variation_price_percentage";
|
|
|
+ $sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
|
|
+ $sql .= " WHERE rowid = ".(int) $rowid;
|
|
|
|
|
|
- if ($obj) {
|
|
|
- return $this->fetchFormObj($obj);
|
|
|
+ $resql = $this->db->query($sql);
|
|
|
+ if ($resql) {
|
|
|
+ $obj = $this->db->fetch_object($resql);
|
|
|
+ if ($obj) {
|
|
|
+ return $this->fetchFormObj($obj);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return -1;
|
|
@@ -1141,11 +1145,14 @@ class ProductCombinationLevel
|
|
|
$sql = "SELECT rowid id";
|
|
|
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
|
|
$sql .= " WHERE fk_product_attribute_combination = ".(int) $this->fk_product_attribute_combination;
|
|
|
- $sql .= ' AND fk_price_level = '.intval($this->fk_price_level);
|
|
|
+ $sql .= ' AND fk_price_level = '.((int) $this->fk_price_level);
|
|
|
|
|
|
- $existObj = $this->db->getRow($sql);
|
|
|
- if ($existObj) {
|
|
|
- $this->id = $existObj->id;
|
|
|
+ $resql = $this->db->query($sql);
|
|
|
+ if ($resql) {
|
|
|
+ $obj = $this->db->fetch_object($resql);
|
|
|
+ if ($obj) {
|
|
|
+ $this->id = $obj->id;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|