|
@@ -78,6 +78,8 @@ func (t *TaskM) SiteTask() {
|
|
|
for _, t := range *task {
|
|
|
l_max_repair_time := qu.Int64All(t["l_max_repair_time"])
|
|
|
t["b_overdue"] = l_max_repair_time < time.Now().Unix()
|
|
|
+ lua, _ := u.MgoEB.FindOneByField("luaconfig", map[string]interface{}{"code": t["s_spidercode"]}, map[string]interface{}{"state": 1})
|
|
|
+ t["i_state"] = (*lua)["state"]
|
|
|
t["encode"] = util.Se.Encode2Hex(fmt.Sprint(t["s_spidercode"]))
|
|
|
}
|
|
|
t.ServeJson(map[string]interface{}{"draw": draw, "data": task, "recordsFiltered": count, "recordsTotal": count})
|
|
@@ -126,6 +128,13 @@ func (t *TaskM) SiteTaskEdit() {
|
|
|
t.ServeJson(result)
|
|
|
}
|
|
|
|
|
|
+func (t *TaskM) UpdateCodeState() {
|
|
|
+ code := t.GetString("code")
|
|
|
+ state, _ := t.GetInteger("state")
|
|
|
+ ok := u.MgoEB.Update("luaconfig", map[string]interface{}{"code": code, "state": 5}, map[string]interface{}{"$set": map[string]interface{}{"state": state}}, false, false)
|
|
|
+ t.ServeJson(map[string]interface{}{"ok": ok})
|
|
|
+}
|
|
|
+
|
|
|
func siteTaskUpdate(query, set map[string]interface{}) bool {
|
|
|
return u.MgoEB.Update("spider_important_warning", query, map[string]interface{}{"$set": set}, false, false)
|
|
|
}
|