Преглед на файлове

fix payment api user crud

tomoya преди 1 година
родител
ревизия
3c25955ba2
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      backend/app/app/api/api_v1/endpoints/payment.py

+ 2 - 2
backend/app/app/api/api_v1/endpoints/payment.py

@@ -348,6 +348,6 @@ CheckMacValue: {CheckMacValue}\
     if 'credit' in content.keys():
       add_credit = content['credit']
       if user := crud.user.get(db=db, id=int(CustomField2)):
-        user.update(db, db_obj=payment, obj_in={"available_time": user.available_tiem + int(add_credit)})
+        crud.user.update(db, db_obj=user, obj_in={"available_time": user.available_time + int(add_credit)})
     crud.payment.update(db, db_obj=payment, obj_in={"payment_state":"succeeded", "remark":json.dumps(remark, ensure_ascii=False)})
-  return Response(content='1', status_code=status.HTTP_200_OK)
+  return Response(content='1', status_code=status.HTTP_200_OK)