This commit is contained in:
hoteas
2021-12-17 01:21:08 +08:00
parent 6b8f901163
commit 8380b097b2
5 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{