Closed DreamSilverFox closed 10 months ago
def getStorageVar(self, key): '''获取储存变量''' resVal = '' dbSession = DB.session() with dbSession.begin(): stmt = select(PPXStorageVar.value).where(PPXStorageVar.key == key) result = dbSession.execute(stmt) result = result.one_or_none() if result is None: # 新建 stmt = insert(PPXStorageVar).values(key=key) dbSession.execute(stmt) else: resVal = result[0] dbSession.close() return resVal def setStorageVar(self, key, val): '''更新储存变量''' dbSession = DB.session() with dbSession.begin(): stmt = update(PPXStorageVar).where(PPXStorageVar.key == key).values(value=val) dbSession.execute(stmt) dbSession.close()
这两个函数是value,但是数据库里的列是val?
已经在V4.2.1版本中修复了该问题,感谢指正!
这两个函数是value,但是数据库里的列是val?