@@ -90,16 +90,28 @@ protected function getQueryColumns(array $columns) : string
9090
9191 protected function getTypeClause ($ where ) : string
9292 {
93- return in_array ($ where ['type ' ], ['In ' , 'Null ' , 'NotNull ' ])
93+ $ type = in_array ($ where ['type ' ], ['In ' , 'Null ' , 'NotNull ' , ' between ' ])
9494 ? strtolower ($ where ['type ' ])
95- : '' ;
95+ : strtolower ($ where ['operator ' ]);
96+
97+ return str_replace (' ' , '_ ' , $ type );
9698 }
9799
98100 protected function getValuesClause (array $ where = null ) : string
99101 {
100- return is_array (array_get ($ where , 'values ' ))
101- ? '_ ' . implode ('_ ' , $ where ['values ' ])
102+ if (in_array ($ where ['type ' ], ['NotNull ' ])) {
103+ return '' ;
104+ }
105+
106+ $ values = is_array (array_get ($ where , 'values ' ))
107+ ? implode ('_ ' , $ where ['values ' ])
102108 : '' ;
109+
110+ if (! $ values && $ this ->query ->bindings ['where ' ] ?? false ) {
111+ $ values = implode ('_ ' , $ this ->query ->bindings ['where ' ]);
112+ }
113+
114+ return '_ ' . $ values ;
103115 }
104116
105117 protected function getWhereClauses (array $ wheres = []) : string
@@ -149,8 +161,7 @@ protected function getOtherClauses(array $where, string $carry = null) : string
149161 return '' ;
150162 }
151163
152- $ value = array_get ($ where , 'value ' );
153- $ value .= $ this ->getTypeClause ($ where );
164+ $ value = $ this ->getTypeClause ($ where );
154165 $ value .= $ this ->getValuesClause ($ where );
155166
156167 return "{$ carry }- {$ where ['column ' ]}_ {$ value }" ;
0 commit comments