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

Missing of Wherein and whereNotIn query handling #70

Open
khleung opened this issue Oct 3, 2020 · 3 comments
Open

Missing of Wherein and whereNotIn query handling #70

khleung opened this issue Oct 3, 2020 · 3 comments
Assignees
Labels

Comments

@khleung
Copy link

khleung commented Oct 3, 2020

I found the latest version never handled the Wherein and whereNotIn clause in the coding
the "values" of $wheres was overlooked. Bindings values were being omitted and caused errors:

To make my Wherein and whereNotIn clauses works,
I added the followings missing coding into if statement of private function compileForSelect(Builder $builder, $bindings) :

 } else if (
                isset($wheres[$ind]['values']) &&
                isset($tipos[strtolower($wheres[$ind]['column'])])
            ) {
                if (is_array($wheres[$ind]['values'])) {

                    foreach ($wheres[$ind]['values'] as $value) {
                        if (
                            in_array(
                                strtolower($tipos[
                                    strtolower($wheres[$ind]['column'])
                                ]),
                                $this->withoutQuotes
                            )
                        ) {
                            if (!is_null($bindings[$i])) {
                                $newBinds[$i] = $bindings[$i] / 1;
                            } else {
                                $newBinds[$i] = null;
                            }
                        } else {
                            $newBinds[$i] = (string) $bindings[$i];
                        }
                        $i++;
                    }
                }
            }
        }
@nunomazer
Copy link
Contributor

Thanks @khleung, I'll analyse it next week

@murbagus
Copy link

hello, have you fix it?

@jcrodriguezt
Copy link

Thanks @khleung your proposal worked for me.

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

Successfully merging a pull request may close this issue.

4 participants