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:
@@ -3,6 +3,7 @@
|
||||
namespace App\DB\Te;
|
||||
|
||||
|
||||
use App\Support\PersianText;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
||||
@@ -37,7 +38,11 @@ class QuerySelector
|
||||
}
|
||||
$cols = explode(',', $conf->cols);
|
||||
if (isset($input['query'])) {
|
||||
$query = $conf->model::where($cols[0], 'like', '%' . $input['query'] . '%');
|
||||
$needle = PersianText::likePattern(strtolower((string) $input['query']));
|
||||
$query = $conf->model::whereRaw(
|
||||
PersianText::sqlFoldExpr('lower(`'.$cols[0].'`)').' like ?',
|
||||
[$needle]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user