|
@@ -585,6 +585,7 @@ func (f *Front) Importfile() {
|
|
|
errorinfo[cells[1].Value] = "第" + strconv.Itoa(k) + "行找不到作者,已经过滤"
|
|
|
} else {
|
|
|
o["author"] = name
|
|
|
+ o["importuser"] = f.GetSession("username")
|
|
|
u.MgoEB.Save("import", o)
|
|
|
}
|
|
|
}
|
|
@@ -740,9 +741,25 @@ func (f *Front) Importdata() {
|
|
|
if f.Method() == "GET" {
|
|
|
f.Render("import.html")
|
|
|
} else {
|
|
|
- rss, _ := u.MgoEB.Find("import", nil, `{"timestamp": -1}`, nil, false, -1, -1)
|
|
|
+ query := map[string]interface{}{}
|
|
|
+ searchStr := f.GetString("search[value]")
|
|
|
+ search := strings.TrimSpace(searchStr)
|
|
|
+ if search != "" {
|
|
|
+ query["$or"] = []interface{}{
|
|
|
+ map[string]interface{}{"code": map[string]interface{}{"$regex": search}},
|
|
|
+ map[string]interface{}{"name": map[string]interface{}{"$regex": search}},
|
|
|
+ }
|
|
|
+ }
|
|
|
+ start, _ := f.GetInteger("start")
|
|
|
+ limit, _ := f.GetInteger("length")
|
|
|
+ draw, _ := f.GetInteger("draw")
|
|
|
+ data, _ := u.MgoEB.Find("import", query, `{"timestamp": -1}`, nil, false, start, limit)
|
|
|
+ count := u.MgoEB.Count("import", query)
|
|
|
f.ServeJson(map[string]interface{}{
|
|
|
- "data": *rss,
|
|
|
+ "draw": draw,
|
|
|
+ "data": data,
|
|
|
+ "recordsFiltered": count,
|
|
|
+ "recordsTotal": count,
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
@@ -1070,7 +1087,7 @@ func (f *Front) SpiderCopy() {
|
|
|
lua, _ := u.MgoEB.FindOne("luaconfig", map[string]interface{}{"code": code})
|
|
|
if len(*lua) > 0 {
|
|
|
codeOld := qu.ObjToString((*lua)["code"])
|
|
|
- codeNew := codeOld + "_bu"
|
|
|
+ codeNew := codeOld + u.Bu
|
|
|
//luaTmp := *mgdb.FindOne("luaconfig", map[string]interface{}{"code": codeNew})
|
|
|
luaTmp, _ := u.MgoEB.FindOne("luaconfig", map[string]interface{}{"code": codeNew})
|
|
|
if len(*luaTmp) > 0 {
|