| | |
| | | func SearchHistoryReport(keyword string, operationType constvar.BaseOperationType, page, pageSize int) (recordIds []int, total uint64, err error) { |
| | | var ids []string |
| | | from := (page - 1) * pageSize |
| | | t, err := parseDateString(keyword) |
| | | t, err := time.ParseInLocation("20060102", keyword, time.Local) |
| | | //t, err := parseDateString(keyword) |
| | | m := make(map[string]interface{}) |
| | | if operationType > 0 { |
| | | m["baseOperationType"] = operationType |
| | | } |
| | | if err != nil && t.IsZero() { |
| | | if err != nil || t.IsZero() { |
| | | ids, total, err = blevex.ComplexSearch(HistoryReportIndexName, keyword, m, from, pageSize) |
| | | } else { |
| | | ids, total, err = blevex.TimeSearch(HistoryReportIndexName, t, m, from, pageSize) |