我在sugarcrm模块中遇到搜索功能问题,我总是在字段框示例中使用% - sign :%john 来显示搜索结果,我只需约翰不是%john
我在/modules/Accounts/Account.php上编辑了我的文件:
function build_generic_where_clause ($the_query_string) {
$where_clauses = Array();
$the_query_string = $GLOBALS['db']->quote($the_query_string);
array_push($where_clauses, "accounts.name like '%$the_query_string%' ");
if (is_numeric($the_query_string)) {
array_push($where_clauses, "accounts.phone_alternate like '%$the_query_string%'");
array_push($where_clauses, "accounts.phone_fax like '%$the_query_string%'");
array_push($where_clauses, "accounts.phone_office like '%$the_query_string%'");
}
并在
编辑/modules/Accounts/metadata/SearchFields.php'name' => array( 'query_type'=>'default', 'operator' => 'like'),
但总是失败, 你有解决方案吗?
解决方案
我编辑了config.php并添加了
'search_wildcard_infront' => true
此致 Rampak