优化系统

This commit is contained in:
hoteas
2021-12-27 18:21:41 +08:00
parent 9ce4f1c603
commit a47473f245
8 changed files with 39 additions and 3575 deletions
+6 -1
View File
@@ -67,8 +67,13 @@ var material_inoutCtr = Ctr{
"admin_id": adminID,
"material_id": materialId})
}
if state == 0 {
that.Db.Update("material", Map{"count[#]": "count+" + ObjToStr(count), "saved[#]": "saved+" + ObjToStr(count)}, Map{"id": materialId})
} else {
that.Db.Update("material", Map{"count[#]": "count" + ObjToStr(count), "used[#]": "used+" + ObjToStr(-count)}, Map{"id": materialId})
}
that.Db.Update("material", Map{"count[#]": "count+" + ObjToStr(count), "saved[#]": "saved+" + ObjToStr(count)}, Map{"id": materialId})
material := that.Db.Get("material", "*", Map{"id": materialId})
data := Map{
"img": img,