From 028cb77d4f5afd7930df5c2b8d722bbdbbbb19aa Mon Sep 17 00:00:00 2001 From: i-just Date: Fri, 26 Jun 2026 13:07:24 +0200 Subject: [PATCH] make the invoice search case-insensitive on pgsql --- src/controllers/InvoicesController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/InvoicesController.php b/src/controllers/InvoicesController.php index 46e4468..1b3f84c 100644 --- a/src/controllers/InvoicesController.php +++ b/src/controllers/InvoicesController.php @@ -66,10 +66,11 @@ public function actionTableData(): Response // searching if ($search) { + $isPgsql = Craft::$app->getDb()->getIsPgsql(); $sqlQuery->andWhere([ 'or', - ['like', "stripe_invoicedata.number", $search], - ['like', "stripe_invoicedata.customerEmail", $search], + [$isPgsql ? 'ilike' : 'like', "stripe_invoicedata.number", $search], + [$isPgsql ? 'ilike' : 'like', "stripe_invoicedata.customerEmail", $search], ]); }