Browse Source

fix payment api user crud

tomoya 1 năm trước cách đây
mục cha
commit
3c25955ba2
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  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)