- $notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
- $notice->orderBy('created DESC');
+ if(common_config('db','type')=='mysql') {
+ $notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')');
+ } else {
+ $notice->whereAdd('to_tsvector(\'english\',content) @@ plainto_tsquery(\''.addslashes($q).'\')');
+ }
+ $notice->orderBy('created DESC, notice.id DESC');