This commit is contained in:
aaron 2025-03-22 16:49:51 +08:00
parent abb0142d9a
commit c3dc4d4c1e
3 changed files with 7 additions and 1 deletions

View File

@ -99,6 +99,7 @@ async def update_address(
if update_data.get("is_default"):
db.query(AddressDB).filter(
and_(
AddressDB.address_type == address.address_type,
AddressDB.user_id == current_user.userid,
AddressDB.is_default == True
)
@ -209,7 +210,10 @@ async def get_address(
"name": address.AddressDB.name,
"phone": address.AddressDB.phone,
"gender": address.AddressDB.gender,
"is_default": address.AddressDB.is_default
"is_default": address.AddressDB.is_default,
"address_type": address.AddressDB.address_type,
"longitude": address.AddressDB.longitude,
"latitude": address.AddressDB.latitude
}
return success_response(data=AddressInfo(**address_data))

View File

@ -20,6 +20,7 @@ from datetime import datetime, timedelta
from sqlalchemy import text
from app.models.community import CommunityDB
from app.models.user_auth import UserAuthDB, UserAuthCreate, UserAuthInfo
from app.models.address import AddressType
from app.core.qcloud import qcloud_manager
from app.models.merchant import MerchantDB
from app.models.address import AddressDB, AddressInfo
@ -103,6 +104,7 @@ async def get_user_info(
CommunityDB,
AddressDB.community_id == CommunityDB.id
).filter(
AddressDB.address_type == AddressType.PICKUP,
AddressDB.user_id == current_user.userid,
AddressDB.is_default == True
).first()

Binary file not shown.