@@ -780,22 +780,25 @@ export class PaymentMethodModel {
780
780
. execute ( )
781
781
}
782
782
783
- private static applyWhere ( instance : PaymentMethodModel , column : string , operator : string , value : any ) : PaymentMethodModel {
784
- instance . selectFromQuery = instance . selectFromQuery . where ( column , operator , value )
785
- instance . updateFromQuery = instance . updateFromQuery . where ( column , operator , value )
786
- instance . deleteFromQuery = instance . deleteFromQuery . where ( column , operator , value )
783
+ private static applyWhere ( instance : PaymentMethodModel , column : string , ...args : any [ ] ) : PaymentMethodModel {
784
+ const [ operatorOrValue , value ] = args
785
+ const operator = value === undefined ? '=' : operatorOrValue
786
+ const actualValue = value === undefined ? operatorOrValue : value
787
+
788
+ instance . selectFromQuery = instance . selectFromQuery . where ( column , operator , actualValue )
789
+ instance . updateFromQuery = instance . updateFromQuery . where ( column , operator , actualValue )
790
+ instance . deleteFromQuery = instance . deleteFromQuery . where ( column , operator , actualValue )
787
791
788
792
return instance
789
793
}
790
794
791
- where ( column : string , operator : string , value : any ) : PaymentMethodModel {
792
- return PaymentMethodModel . applyWhere ( this , column , operator , value )
795
+ where ( column : string , ... args : any [ ] ) : PaymentMethodModel {
796
+ return PaymentMethodModel . applyWhere ( this , column , ... args )
793
797
}
794
798
795
- static where ( column : string , operator : string , value : any ) : PaymentMethodModel {
799
+ static where ( column : string , ... args : any [ ] ) : PaymentMethodModel {
796
800
const instance = new PaymentMethodModel ( null )
797
-
798
- return PaymentMethodModel . applyWhere ( instance , column , operator , value )
801
+ return PaymentMethodModel . applyWhere ( instance , column , ...args )
799
802
}
800
803
801
804
whereColumn ( first : string , operator : string , second : string ) : PaymentMethodModel {
0 commit comments