我有一个自定义字段,名为代码上的帐户模块,我想启用它的全局搜索,使其搜索没有通配符输入的搜索栏。
因此,假设我有一些值为"88990“、"23477”和"12347“的记录。如果有人使用全局搜索并输入347,它应该返回给我代码为23477和12347的帐户。我不想在结果中输入%347。我如何才能做到这一点?我在custom/Extension/modules/Account/Ext/Vardefs/sugarfield_code_c.php上有代码
$dictionary['Account']['fields']['code_c']['inline_edit']='1';
$dictionary['Account']['fields']['code_c']['labelValue']='test code';
$dictionary['Account']['fields']['code_c']['unified_search']=true;在自定义/modules/Accounts/SearchFields.php上,我有
$searchFields['Accounts'] = array(
'code_c' =>
array(
'query_type' => 'default'
)
);发布于 2018-04-20 00:58:30
SuiteCRM版本: 7.10.4
:解决方案升级不安全。
导航到include/SearchForm/SearchForm2.php并在generateSearchWhere()函数中查找以下内容:
$where .= $this->seed->db->concat($concat_table, $concat_fields) . " LIKE " . $this->seed->db->quoted($field_value . $like_char);
$where .= ' OR ' . $this->seed->db->concat($concat_table, array_reverse($concat_fields)) . " LIKE " . $this->seed->db->quoted($field_value . $like_char);我更改了这一行,以便在$field_value之前连接$like_char变量
$where .= $this->seed->db->concat($concat_table, $concat_fields) . " LIKE " . $this->seed->db->quoted($like_char . $field_value . $like_char);
$where .= ' OR ' . $this->seed->db->concat($concat_table, array_reverse($concat_fields)) . " LIKE " . $this->seed->db->quoted($like_char . $field_value . $like_char);https://stackoverflow.com/questions/48472596
复制相似问题