@@ -98,15 +98,20 @@ public function getViewId(): ?int
98
98
public function getQueryParams (): array
99
99
{
100
100
$ query = [];
101
-
102
- if ($ this ->getFilters ()) {
103
- $ query = $ this ->getFilters ();
104
- }
105
- if ($ this ->getFields ()) {
106
- $ query ['fields ' ] = implode (', ' , $ this ->getFields ());
107
- }
108
- if ($ this ->getInclude ()) {
109
- $ query ['include ' ] = implode (', ' , $ this ->getInclude ());
101
+ $ filters = $ this ->getFilters ();
102
+
103
+ if ($ filters ) {
104
+ $ query = $ filters ;
105
+ } else {
106
+ if ($ this ->getFields ()) {
107
+ $ query ['fields ' ] = implode (', ' , $ this ->getFields ());
108
+ }
109
+ if ($ this ->getInclude ()) {
110
+ $ query ['include ' ] = implode (', ' , $ this ->getInclude ());
111
+ }
112
+ if ($ this ->getViewId ()) {
113
+ $ query ['viewId ' ] = $ this ->getViewId ();
114
+ }
110
115
}
111
116
if ($ this ->getFrom ()) {
112
117
$ query ['from ' ] = $ this ->getFrom ();
@@ -117,9 +122,6 @@ public function getQueryParams(): array
117
122
if ($ this ->getSortBy ()) {
118
123
$ query ['sortBy ' ] = ($ this ->getSortOrder () === 'DESC ' ? '- ' : '' ) . $ this ->getSortBy ();
119
124
}
120
- if ($ this ->getViewId ()) {
121
- $ query ['viewId ' ] = $ this ->getViewId ();
122
- }
123
125
124
126
return $ query ;
125
127
}
0 commit comments