diff --git a/protected/models/product/ProductParameterName.php b/protected/models/product/ProductParameterName.php index 303527c5..9612df40 100644 --- a/protected/models/product/ProductParameterName.php +++ b/protected/models/product/ProductParameterName.php @@ -90,7 +90,7 @@ public function defaultScope() */ public function getRootId() { - return $this->findBySql("SELECT * FROM ".$this->dbConnection->schema->quoteTableName($this->tableName())." WHERE parent = id")->id; + return $this->find('parent = id')->id; } /** @@ -319,4 +319,4 @@ public function getImage() { return 'f/upload/images/param_'.$this->id.'.png'; } -} \ No newline at end of file +}