fix(search): match Arabic ye/kaf with Persian letters in admin search
Customer names stored with ي/ك were missed when typing ی/ک; fold both sides of LIKE. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,6 +10,7 @@ use App\Models\AppNotificationRecipient;
|
||||
use App\Models\Customer;
|
||||
use App\Services\AppNotificationAudienceService;
|
||||
use App\Services\PriceStreamService;
|
||||
use App\Support\PersianText;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
@@ -67,7 +68,10 @@ class AppNotificationController extends Controller
|
||||
->where('is_archive', false)
|
||||
->when($q !== '', function ($query) use ($q) {
|
||||
$query->where(function ($inner) use ($q) {
|
||||
$inner->where('name', 'like', '%' . $q . '%')
|
||||
$inner->whereRaw(
|
||||
PersianText::sqlFoldExpr('lower(`name`)').' like ?',
|
||||
[PersianText::likePattern(strtolower($q))]
|
||||
)
|
||||
->orWhere('mobile', 'like', '%' . $q . '%')
|
||||
->orWhere('id', $q);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user