This commit is contained in:
@@ -2,6 +2,7 @@ using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using AyaNova.Biz;
|
||||
using AyaNova.Util;
|
||||
|
||||
namespace AyaNova.PickList
|
||||
{
|
||||
@@ -130,7 +131,13 @@ namespace AyaNova.PickList
|
||||
//so this will handle it as a like query against all tags as a composite string of text just like
|
||||
//all the other templated fields
|
||||
if (HasAutoCompleteQuery && !HasTagSpecificQuery)
|
||||
sWhere = $"(array_to_string({valueColumnName},',') like '%{autoCompleteQuery}%')";
|
||||
{
|
||||
if (ServerGlobalBizSettings.SearchCaseSensitiveOnly)
|
||||
sWhere = $"(array_to_string({valueColumnName},',') like '%{autoCompleteQuery}%')";
|
||||
else
|
||||
sWhere = $"(lower(array_to_string({valueColumnName},',')) like lower('%{autoCompleteQuery}%'))";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (o.ColumnDataType == UiFieldDataType.Text || o.ColumnDataType == UiFieldDataType.EmailAddress || o.ColumnDataType == UiFieldDataType.HTTP)
|
||||
@@ -140,7 +147,11 @@ namespace AyaNova.PickList
|
||||
lSelect.Add(valueColumnName);
|
||||
lOrderBy.Add(valueColumnName);
|
||||
if (HasAutoCompleteQuery)
|
||||
sWhere = $"({valueColumnName} like '%{autoCompleteQuery}%')";
|
||||
if (ServerGlobalBizSettings.SearchCaseSensitiveOnly)
|
||||
sWhere = $"({valueColumnName} like '%{autoCompleteQuery}%')";
|
||||
else
|
||||
sWhere = $"(lower({valueColumnName}) like lower('%{autoCompleteQuery}%'))";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -158,7 +169,10 @@ namespace AyaNova.PickList
|
||||
//Where fragment is different for non text fields: it needs to be cast to text to like query on it
|
||||
//(cast (awidget.serial as text) like '%some%')
|
||||
if (HasAutoCompleteQuery)
|
||||
if (ServerGlobalBizSettings.SearchCaseSensitiveOnly)
|
||||
sWhere = $"(cast ({valueColumnName} as text) like '%{autoCompleteQuery}%')";
|
||||
else
|
||||
sWhere = $"(lower(cast ({valueColumnName} as text)) like lower('%{autoCompleteQuery}%'))";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user