uepg/laravel-sybase

Missing of Wherein and whereNotIn query handling

Opened this issue · 3 comments

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++;
                    }
                }
            }
        }

Thanks @khleung, I'll analyse it next week

hello, have you fix it?

Thanks @khleung your proposal worked for me.