改buge
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user