Skip to content

Commit

Permalink
Merge pull request #5097 in SW/shopware from sw-18915/5.2/fix-sql-cha…
Browse files Browse the repository at this point in the history
…nges to 5.2

* commit '2274f7b0dc040f91bf0efc4a1e251bab0877609f':
  SW-18915 - Fix order search query
  SW-18915 - Fix customer module detail query
  • Loading branch information
MarcelSchmaeing committed Jun 21, 2017
2 parents 1f28ce3 + 2274f7b commit fae8088
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions engine/Shopware/Models/Customer/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ public function getOrdersQueryBuilder($customerId, $filter = null, $orderBy = nu
->leftJoin('orders.orderStatus', 'orderStatus')
->leftJoin('orders.paymentStatus', 'paymentStatus');

$expr = Shopware()->Models()->getExpressionBuilder();
//filter the displayed columns with the passed filter string
if (!empty($filter)) {
$builder->where('orders.customerId = :customerId');
Expand All @@ -347,11 +346,13 @@ public function getOrdersQueryBuilder($customerId, $filter = null, $orderBy = nu
)
->setParameter(1, $filter . '%')
->setParameter(2, '%' . $filter)
->setParameter(3, str_replace('.', '_', str_replace(',', '_', $filter)) . '%');
->setParameter(3, str_replace('.', '_', str_replace(',', '_', $filter)) . '%')
->setParameter('customerId', $customerId);
} else {
$builder->where('orders.customerId = :customerId')->setParameter('customerId', $customerId);
}
$builder->andWhere('orders.status NOT IN (-1, 4)');
$builder->andWhere('orders.status NOT IN (:stati)');
$builder->setParameter(':stati', [-1, 4], Connection::PARAM_INT_ARRAY);

$this->addOrderBy($builder, $orderBy);

Expand Down

0 comments on commit fae8088

Please sign in to comment.