diff --git a/Model/ResourceModel/CategoryWidget.php b/Model/ResourceModel/CategoryWidget.php index 3ef608cf41e50bb0a4aa2e4dcd3c21ecc2ad8e80..0a59c5a305d4a735ea8fa27ea46a3d39bdb9584d 100755 --- a/Model/ResourceModel/CategoryWidget.php +++ b/Model/ResourceModel/CategoryWidget.php @@ -166,12 +166,12 @@ class CategoryWidget extends AbstractDb $stores = [(int)$object->getStoreId(), Store::DEFAULT_STORE_ID]; $select->join( - ['niis' => $this->getTable('nicolasbejean_categorywidget_store')], - $this->getMainTable() . '.' . $linkField . ' = niis.' . $linkField, + ['ncws' => $this->getTable('nicolasbejean_categorywidget_store')], + $this->getMainTable() . '.' . $linkField . ' = ncws.' . $linkField, ['store_id'] ) ->where('is_active = ?', 1) - ->where('niis.store_id in (?)', $stores) + ->where('ncws.store_id in (?)', $stores) ->order('store_id DESC') ->limit(1); } @@ -200,17 +200,17 @@ class CategoryWidget extends AbstractDb } $select = $this->getConnection()->select() - ->from(['nii' => $this->getMainTable()]) + ->from(['ncw' => $this->getMainTable()]) ->join( - ['niis' => $this->getTable('nicolasbejean_categorywidget_store')], - 'nii.' . $linkField . ' = niis.' . $linkField, + ['ncws' => $this->getTable('nicolasbejean_categorywidget_store')], + 'ncw.' . $linkField . ' = ncws.' . $linkField, [] ) - ->where('nii.identifier = ?', $object->getData('identifier')) - ->where('niis.store_id IN (?)', $stores); + ->where('ncw.identifier = ?', $object->getData('identifier')) + ->where('ncws.store_id IN (?)', $stores); if ($object->getId()) { - $select->where('nii.' . $entityMetadata->getIdentifierField() . ' <> ?', $object->getId()); + $select->where('ncw.' . $entityMetadata->getIdentifierField() . ' <> ?', $object->getId()); } if ($this->getConnection()->fetchRow($select)) { @@ -236,13 +236,13 @@ class CategoryWidget extends AbstractDb $linkField = $entityMetadata->getLinkField(); $select = $connection->select() - ->from(['niis' => $this->getTable('nicolasbejean_categorywidget_store')], 'store_id') + ->from(['ncws' => $this->getTable('nicolasbejean_categorywidget_store')], 'store_id') ->join( - ['nii' => $this->getMainTable()], - 'niis.' . $linkField . ' = nii.' . $linkField, + ['ncw' => $this->getMainTable()], + 'ncws.' . $linkField . ' = ncw.' . $linkField, [] ) - ->where('nii.' . $entityMetadata->getIdentifierField() . ' = :entity_id'); + ->where('ncw.' . $entityMetadata->getIdentifierField() . ' = :entity_id'); return $connection->fetchCol($select, ['entity_id' => (int)$id]); }