Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

f_params[limit]=XXX not working as expected #162

Closed
gregoirer opened this issue Apr 9, 2021 · 1 comment
Closed

f_params[limit]=XXX not working as expected #162

gregoirer opened this issue Apr 9, 2021 · 1 comment

Comments

@gregoirer
Copy link

gregoirer commented Apr 9, 2021

Hello,

When we use f_params[limit]=\d it gives one result only whatever the limit we provide (it act like we have queried f_params[limit]=1) .

Suggested fix below:

public function apply($query): Builder
{
foreach ($this->values as $key => $param) {
if (!in_array($key, self::$reserve_param['f_params'])) {
throw new \Exception("$key is not in f_params array.");
}
if (is_array($param)) {
$this->values['orderBy']['field'] = explode(',', $this->values['orderBy']['field']);
foreach ($this->values['orderBy']['field'] as $order_by) {
$query->orderBy($order_by, $this->values['orderBy']['type']);
}
} else {
$query->limit($param);
}
}

    return $query;
}
@mehdi-fathi
Copy link
Owner

@gregoirer Thanks for this report. This bug will fix in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants