Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit 578884de authored by Nicolas's avatar Nicolas
Browse files

Modification des alias des requêtes SQL

parent 0a7d1276
No related branches found
No related tags found
No related merge requests found
...@@ -166,12 +166,12 @@ class CategoryWidget extends AbstractDb ...@@ -166,12 +166,12 @@ class CategoryWidget extends AbstractDb
$stores = [(int)$object->getStoreId(), Store::DEFAULT_STORE_ID]; $stores = [(int)$object->getStoreId(), Store::DEFAULT_STORE_ID];
$select->join( $select->join(
['niis' => $this->getTable('nicolasbejean_categorywidget_store')], ['ncws' => $this->getTable('nicolasbejean_categorywidget_store')],
$this->getMainTable() . '.' . $linkField . ' = niis.' . $linkField, $this->getMainTable() . '.' . $linkField . ' = ncws.' . $linkField,
['store_id'] ['store_id']
) )
->where('is_active = ?', 1) ->where('is_active = ?', 1)
->where('niis.store_id in (?)', $stores) ->where('ncws.store_id in (?)', $stores)
->order('store_id DESC') ->order('store_id DESC')
->limit(1); ->limit(1);
} }
...@@ -200,17 +200,17 @@ class CategoryWidget extends AbstractDb ...@@ -200,17 +200,17 @@ class CategoryWidget extends AbstractDb
} }
$select = $this->getConnection()->select() $select = $this->getConnection()->select()
->from(['nii' => $this->getMainTable()]) ->from(['ncw' => $this->getMainTable()])
->join( ->join(
['niis' => $this->getTable('nicolasbejean_categorywidget_store')], ['ncws' => $this->getTable('nicolasbejean_categorywidget_store')],
'nii.' . $linkField . ' = niis.' . $linkField, 'ncw.' . $linkField . ' = ncws.' . $linkField,
[] []
) )
->where('nii.identifier = ?', $object->getData('identifier')) ->where('ncw.identifier = ?', $object->getData('identifier'))
->where('niis.store_id IN (?)', $stores); ->where('ncws.store_id IN (?)', $stores);
if ($object->getId()) { if ($object->getId()) {
$select->where('nii.' . $entityMetadata->getIdentifierField() . ' <> ?', $object->getId()); $select->where('ncw.' . $entityMetadata->getIdentifierField() . ' <> ?', $object->getId());
} }
if ($this->getConnection()->fetchRow($select)) { if ($this->getConnection()->fetchRow($select)) {
...@@ -236,13 +236,13 @@ class CategoryWidget extends AbstractDb ...@@ -236,13 +236,13 @@ class CategoryWidget extends AbstractDb
$linkField = $entityMetadata->getLinkField(); $linkField = $entityMetadata->getLinkField();
$select = $connection->select() $select = $connection->select()
->from(['niis' => $this->getTable('nicolasbejean_categorywidget_store')], 'store_id') ->from(['ncws' => $this->getTable('nicolasbejean_categorywidget_store')], 'store_id')
->join( ->join(
['nii' => $this->getMainTable()], ['ncw' => $this->getMainTable()],
'niis.' . $linkField . ' = nii.' . $linkField, 'ncws.' . $linkField . ' = ncw.' . $linkField,
[] []
) )
->where('nii.' . $entityMetadata->getIdentifierField() . ' = :entity_id'); ->where('ncw.' . $entityMetadata->getIdentifierField() . ' = :entity_id');
return $connection->fetchCol($select, ['entity_id' => (int)$id]); return $connection->fetchCol($select, ['entity_id' => (int)$id]);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment