File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -147,15 +147,16 @@ private static function _get_model_info() {
147
147
* the field to map
148
148
*
149
149
*/
150
- public static function map ($ field = 'id ' ) {
150
+ public static function map ($ field = 'id ' , $ filters = [] ) {
151
151
$ model = self ::_get_model_info ();
152
152
if (!$ model ) return false ;
153
153
if (!self ::get_field ($ field )) return false ;
154
154
155
155
$ table = $ model ['table ' ];
156
156
$ active_field = self ::get_field ('active ' ) ? "active = 1 " : "" ;
157
157
158
- $ data = self ::query ("SELECT $ field FROM ` $ table` WHERE $ active_field " );
158
+ $ filters_str = self ::create_filter ($ filters , $ binds );
159
+ $ data = self ::query ("SELECT $ field FROM ` $ table` WHERE $ active_field $ filters_str " , $ binds );
159
160
if (!$ data ) return [];
160
161
161
162
return array_map (function ($ row ) use ($ field ) {
You can’t perform that action at this time.
0 commit comments