|
@@ -3,6 +3,7 @@ package manage
|
|
|
import (
|
|
|
"fmt"
|
|
|
"github.com/go-xweb/xweb"
|
|
|
+ "gopkg.in/mgo.v2/bson"
|
|
|
"html/template"
|
|
|
. "qfw/coreconfig"
|
|
|
"qfw/util"
|
|
@@ -234,10 +235,21 @@ func (e *Exhibition) GetExhibitionJsonList() error {
|
|
|
}
|
|
|
size, _ := e.GetInteger("perPage")
|
|
|
currentPage, _ := e.GetInteger("currentPage")
|
|
|
+ contenttype, _ := e.GetInt("contenttype")
|
|
|
+ search := e.GetString("query")
|
|
|
if size <= 0 || size > 100 {
|
|
|
size = 20
|
|
|
}
|
|
|
- data := Find("exhibition_info", nil, `{"update_time": -1}`, nil, false, (currentPage-1)*size, size)
|
|
|
+ query := make(bson.M)
|
|
|
+ if contenttype != 0 {
|
|
|
+ query["type"] = contenttype
|
|
|
+ }
|
|
|
+ if search != "" {
|
|
|
+ query["title"] = map[string]interface{}{
|
|
|
+ "$regex": search,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ data := Find("exhibition_info", query, `{"update_time": -1}`, nil, false, (currentPage-1)*size, size)
|
|
|
for _, v := range *data {
|
|
|
release := v["creation_time"]
|
|
|
v["creation_time"] = util.FormatDateWithObj(&release, util.Date_Short_Layout)
|