示例#1
0
 public function getParentCategory($categoryId, $siteId = 1)
 {
     $table = 'catalog_category_website';
     $linker = 'catalog_category';
     $joinString = $table . '.parent_category_id = ' . $linker . '.category_id';
     $where = new \Zend\Db\Sql\Where();
     $where->equalTo('website_id', $siteId);
     $where->equalTo($table . '.category_id', $categoryId);
     $where->isNotNull($table . '.parent_category_id');
     $select = $this->getSelect($table)->join($linker, $joinString)->where($where);
     return $this->selectOneModel($select);
 }