update
This commit is contained in:
parent
abb0142d9a
commit
c3dc4d4c1e
@ -99,6 +99,7 @@ async def update_address(
|
|||||||
if update_data.get("is_default"):
|
if update_data.get("is_default"):
|
||||||
db.query(AddressDB).filter(
|
db.query(AddressDB).filter(
|
||||||
and_(
|
and_(
|
||||||
|
AddressDB.address_type == address.address_type,
|
||||||
AddressDB.user_id == current_user.userid,
|
AddressDB.user_id == current_user.userid,
|
||||||
AddressDB.is_default == True
|
AddressDB.is_default == True
|
||||||
)
|
)
|
||||||
@ -209,7 +210,10 @@ async def get_address(
|
|||||||
"name": address.AddressDB.name,
|
"name": address.AddressDB.name,
|
||||||
"phone": address.AddressDB.phone,
|
"phone": address.AddressDB.phone,
|
||||||
"gender": address.AddressDB.gender,
|
"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))
|
return success_response(data=AddressInfo(**address_data))
|
||||||
@ -20,6 +20,7 @@ from datetime import datetime, timedelta
|
|||||||
from sqlalchemy import text
|
from sqlalchemy import text
|
||||||
from app.models.community import CommunityDB
|
from app.models.community import CommunityDB
|
||||||
from app.models.user_auth import UserAuthDB, UserAuthCreate, UserAuthInfo
|
from app.models.user_auth import UserAuthDB, UserAuthCreate, UserAuthInfo
|
||||||
|
from app.models.address import AddressType
|
||||||
from app.core.qcloud import qcloud_manager
|
from app.core.qcloud import qcloud_manager
|
||||||
from app.models.merchant import MerchantDB
|
from app.models.merchant import MerchantDB
|
||||||
from app.models.address import AddressDB, AddressInfo
|
from app.models.address import AddressDB, AddressInfo
|
||||||
@ -103,6 +104,7 @@ async def get_user_info(
|
|||||||
CommunityDB,
|
CommunityDB,
|
||||||
AddressDB.community_id == CommunityDB.id
|
AddressDB.community_id == CommunityDB.id
|
||||||
).filter(
|
).filter(
|
||||||
|
AddressDB.address_type == AddressType.PICKUP,
|
||||||
AddressDB.user_id == current_user.userid,
|
AddressDB.user_id == current_user.userid,
|
||||||
AddressDB.is_default == True
|
AddressDB.is_default == True
|
||||||
).first()
|
).first()
|
||||||
|
|||||||
BIN
jobs.sqlite
BIN
jobs.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user