This commit is contained in:
hoteas
2021-12-17 01:21:08 +08:00
parent 3ce77221f8
commit 55e60ac0eb
4 changed files with 44 additions and 3 deletions
+9
View File
@@ -59,6 +59,15 @@ var material_inoutCtr = Ctr{
count = -count
}
produce_material := that.Db.Get("produce_material", "id", Map{"AND": Map{"produce_id": produceId, "material_id": materialId}})
if produce_material == nil {
that.Db.Insert("produce_material", Map{"produce_id": produceId,
"create_time": time.Now().Unix(),
"modify_time": time.Now().Unix(),
"admin_id": adminID,
"material_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{