Commit f37418c2 authored by 于飞's avatar 于飞

修改问答对编辑

parent 4325e913
......@@ -70,16 +70,12 @@ class QuestionDal(DalBase):
self.schema = schemas.QuestionOut
async def update_question_datas(self, params: QuestionEditParams) -> None:
if params.group_id is not None:
# 文件分组不为空 判定为移动分组
sql = update(self.model).where(self.model.id.in_(params.ids)).values(group_id=params.group_id)
await self.db.execute(sql)
else:
# 否则判定为修改问答对
sql = update(self.model).where(self.model.id.in_(params.ids)).values(title=params.title,
key_word=params.key_word,
answer=params.answer)
await self.db.execute(sql)
sql = update(self.model).where(self.model.id.in_(params.ids)).values(group_id=params.group_id,
title=params.title,
key_word=params.key_word,
answer=params.answer)
await self.db.execute(sql)
class CorrelationDal(DalBase):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment