diff --git a/src/QUI/ERP/Coupons/CouponCode.php b/src/QUI/ERP/Coupons/CouponCode.php index b6ef5d56d81112e039c56ffa9fd8783a85f59fdb..87a36449817fe9ad355061565101bfbac5bab07b 100644 --- a/src/QUI/ERP/Coupons/CouponCode.php +++ b/src/QUI/ERP/Coupons/CouponCode.php @@ -7,7 +7,6 @@ use QUI; use QUI\ERP\Discount\Handler as DiscountHandler; use QUI\ERP\Order\AbstractOrder; -use QUI\ERP\Order\Order; use QUI\ERP\Order\OrderInterface; use QUI\ExceptionStack; use QUI\Interfaces\Users\User; @@ -123,7 +122,7 @@ public function __construct(int $id) 'id' => $id ] ]); - } catch (QUI\DataBase\Exception $Exception) { + } catch (QUI\Database\Exception $Exception) { QUI\System\Log::addError($Exception->getMessage()); throw new CouponCodeException([ @@ -591,7 +590,7 @@ public function delete(): void Handler::getTable(), ['id' => $this->id] ); - } catch (QUI\DataBase\Exception $Exception) { + } catch (QUI\Database\Exception $Exception) { QUI\System\Log::addError($Exception->getMessage()); } diff --git a/src/QUI/ERP/Coupons/Handler.php b/src/QUI/ERP/Coupons/Handler.php index dbd16d3468955d9b428df92a8e00ddbe3f7adda2..ae0a2b0ff2c0e4d6a37c2813bb73e4734015ec7c 100644 --- a/src/QUI/ERP/Coupons/Handler.php +++ b/src/QUI/ERP/Coupons/Handler.php @@ -340,14 +340,12 @@ public static function search(array $searchParams, bool $countOnly = false): arr $whereOr[] = '`' . $searchColumn . '` LIKE :search'; } - if (!empty($whereOr)) { - $where[] = '(' . implode(' OR ', $whereOr) . ')'; + $where[] = '(' . implode(' OR ', $whereOr) . ')'; - $binds['search'] = [ - 'value' => '%' . $searchParams['search'] . '%', - 'type' => PDO::PARAM_STR - ]; - } + $binds['search'] = [ + 'value' => '%' . $searchParams['search'] . '%', + 'type' => PDO::PARAM_STR + ]; } // build WHERE query string