This commit is contained in:
2026-09-21 22:22:32 +08:00
parent c996fe00f0
commit 2c969c7b9c
4 changed files with 12 additions and 11 deletions
+6 -5
View File
@@ -14,16 +14,17 @@ def add_tea_dao(t,db):
return True
#更新
def update_tea_dao(id,update_data,db):
def add_tea_dao(t, db):
try:
rows = db.query(Tea).filter(Tea.id == id
,Tea.is_delete == False).update(update_data)
except:
t1 = Tea(**t)
db.add(t1)
except Exception as e:
db.rollback()
print('新增失败原因:', e)
return False
else:
db.commit()
return rows
return True
#查询
def get_tea_dao(t,db):