mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-19 08:50:46 +00:00
Implement IIF function; Fix empty object select
This commit is contained in:
@@ -16,3 +16,16 @@ func (r rowContext) misc_In(arguments []interface{}) bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func (r rowContext) misc_Iif(arguments []interface{}) interface{} {
|
||||
if len(arguments) != 3 {
|
||||
return nil
|
||||
}
|
||||
|
||||
condition := r.resolveSelectItem(arguments[0].(parsers.SelectItem))
|
||||
if condition != nil && condition == true {
|
||||
return r.resolveSelectItem(arguments[1].(parsers.SelectItem))
|
||||
}
|
||||
|
||||
return r.resolveSelectItem(arguments[2].(parsers.SelectItem))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user