// GetAllWithCondition attempts retrieve all models based on the given model and condition from the database.
GetAllWithCondition attempts retrieve all models based on the given model and condition from the database.
// GetAllWithCondition attempts retrieve all models based on the given model and condition from the database .
func (d *Database) GetAllWithCondition(model interface{}, condition interface{}, args ...interface{}) error {
	conditionStr := checkIfString(condition)
	if len(conditionStr) == 0 {
		d.Warn("GetWithCondition", "Bad condition")
		return errors.New("Bad condition")
	}
	if err := d.DB.Model(model).Where(conditionStr, args...).Select(); err != nil {
		d.Error("GetAllWithCondition", "Models not get", err)
		return  errors.New("Could not get all models")
	}
	d.Success("GetAllWithCondition", "Model retrieve successfully")
	return nil
}
func ( d * Database ) GetAllWithCondition ( model interface { } , condition interface { } , args ... interface { } ) error { conditionStr := checkIfString ( condition ) if len ( conditionStr ) == 0 { d . Warn ( " " , " " ) return errors . New ( " " ) } if err := d . DB . Model ( model ) . Where ( conditionStr , args ... ) . Select ( ) ; err != nil { d . Error ( " " , " " , err ) return errors . New ( " " ) } d . Success ( " " , " " ) return nil }
GetAllWithCondition attempts retrieve all models based on the given model and condition from the database.
GetAllWithCondition attempts retrieve all models based on the given model and condition from the database .