增加了2个field:
最高出价price_max
最低出价price_min
在advanced search里面,希望实现两种搜索:
1、price_max>5000
2、price_min<1000
请问如何修改?多谢指教!
增加了2个field:
最高出价price_max
最低出价price_min
在advanced search里面,希望实现两种搜索:
1、price_max>5000
2、price_min<1000
请问如何修改?多谢指教!
Open source, open data, open life in the commercial environment.
- SugarCRM Google search,用Google查找SugarCRM相关问题
如果你不是开发人员,就用helion 推荐的插件好了,免费版的已经可以满足你的需求了。如果是开发人员,实现这样的东西还是不算太难,自己扩展 一个controller,扩展一个view, Model就复用本身的模块就OK了。sugar 定制起来还是很方便灵活的。
纯粹CRM 爱好者, 研究过 sugarCRM, salesforce, Siebel, EBS ……
Open source, open world.
There is no perfect in the world, but we could be better if we are still alive!
Tony.Wu
Sugar的MVC大部分是针对模块级别, 在Field级别修改有些不太一样.
如果开发参考EnhancedSearch的实现, 也会很有帮助.
Open source, open data, open life in the commercial environment.
- SugarCRM Google search,用Google查找SugarCRM相关问题
类似的参考。 5.2版本中, 搜索大于或等于某个时间的数据
1. 这个文件 modules\模块名称\metadata\SearchFields.php , 改为如下:
'stockin_date'=> array('query_type'=>'default','operator'=>'>='),
2. include\SearchForm\SearchForm2.php
因为 时间变量在vardefs.php文件中'type' => 'date',, 关于date类型sugarcrm中做了如下处理, 620行左右
Code:if($type == 'date') { // Collin - Have mysql as first because it's usually the case // The regular expression check is to circumvent special case YYYY-MM if($GLOBALS['db']->dbType == 'mysql') { if(preg_match('/^\d{4}.\d{1,2}$/', $field_value) == 0) { $field_value = $timedate->to_db_date($field_value, false); $operator = '>='; } else { $operator = 'db_date'; } }
2.1 同一文件中,720行左右增加如下
Code:在代码 switch(strtolower($operator)) { 中,增加 // Add other operators, liugang case '>=': $where .= $db_field . " >= '".$field_value ."'"; break; case '>': $where .= $db_field . " > '".$field_value ."'"; break; case '<=': $where .= $db_field . " <= '".$field_value ."'"; break; case '<': $where .= $db_field . " < '".$field_value ."'"; break; //end
Last edited by allenl; 2010-05-28 at 07:36 AM.
多谢指教,正在摸索中!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks