This commit is contained in:
aaron 2025-03-25 14:30:15 +08:00
parent 4f074561d0
commit 8a11199584
2 changed files with 3 additions and 2 deletions

View File

@ -16,7 +16,7 @@ from sqlalchemy import func
from sqlalchemy.orm import joinedload from sqlalchemy.orm import joinedload
from app.models.merchant_product import OperationType, DeliveryType, DeliveryTimeType from app.models.merchant_product import OperationType, DeliveryType, DeliveryTimeType
from app.models.merchant import MerchantInfo from app.models.merchant import MerchantInfo
from app.models.address import AddressDB, AddressInfo from app.models.address import AddressDB, AddressInfo, AddressType
from app.api.deps import get_current_user from app.api.deps import get_current_user
router = APIRouter() router = APIRouter()
@ -148,7 +148,8 @@ async def get_product(
# 获取默认地址 # 获取默认地址
default_address = db.query(AddressDB).filter( default_address = db.query(AddressDB).filter(
AddressDB.user_id == current_user.userid, AddressDB.user_id == current_user.userid,
AddressDB.is_default == True AddressDB.is_default == True,
AddressDB.address_type == AddressType.COMMON
).first() ).first()
if default_address: if default_address:

Binary file not shown.