Maurits van der Schee 4 years ago
parent
commit
0ee6edb534
2 changed files with 4 additions and 10 deletions
  1. 2
    5
      api.php
  2. 2
    5
      src/Tqdev/PhpCrudApi/Record/FilterInfo.php

+ 2
- 5
api.php View File

@@ -9942,11 +9942,8 @@ namespace Tqdev\PhpCrudApi\Record {
9942 9942
             $conditions = new PathTree();
9943 9943
             foreach ($params as $key => $filters) {
9944 9944
                 if (substr($key, 0, 6) == 'filter') {
9945
-                    $path = [];
9946
-                    $suffix = substr($key, 6);
9947
-                    if ($suffix) {
9948
-                        $path = str_split($suffix);
9949
-                    }
9945
+                    preg_match_all('/\d+|\D+/', substr($key, 6), $matches);
9946
+                    $path = $matches[0];
9950 9947
                     foreach ($filters as $filter) {
9951 9948
                         $condition = Condition::fromString($table, $filter);
9952 9949
                         if (($condition instanceof NoCondition) == false) {

+ 2
- 5
src/Tqdev/PhpCrudApi/Record/FilterInfo.php View File

@@ -15,11 +15,8 @@ class FilterInfo
15 15
         $conditions = new PathTree();
16 16
         foreach ($params as $key => $filters) {
17 17
             if (substr($key, 0, 6) == 'filter') {
18
-                $path = [];
19
-                $suffix = substr($key, 6);
20
-                if ($suffix) {
21
-                    $path = str_split($suffix);
22
-                }
18
+                preg_match_all('/\d+|\D+/', substr($key, 6), $matches);
19
+                $path = $matches[0];
23 20
                 foreach ($filters as $filter) {
24 21
                     $condition = Condition::fromString($table, $filter);
25 22
                     if (($condition instanceof NoCondition) == false) {

Loading…
Cancel
Save