update
This commit is contained in:
parent
ee0df23a11
commit
faeb44b43f
@ -28,6 +28,7 @@ async def create_address(
|
||||
).update({"is_default": False})
|
||||
|
||||
# 查询社区名字和楼栋名字
|
||||
if address.community_id:
|
||||
community = db.query(CommunityDB).filter(
|
||||
CommunityDB.id == address.community_id
|
||||
).first()
|
||||
@ -42,6 +43,11 @@ async def create_address(
|
||||
community_building_name=community_building.building_name,
|
||||
**address.model_dump()
|
||||
)
|
||||
else:
|
||||
db_address = AddressDB(
|
||||
user_id=current_user.userid,
|
||||
**address.model_dump()
|
||||
)
|
||||
|
||||
db.add(db_address)
|
||||
db.commit()
|
||||
|
||||
@ -160,3 +160,6 @@ ALTER TABLE merchants
|
||||
ADD COLUMN community_id INT COMMENT '所属小区' AFTER user_id,
|
||||
ADD CONSTRAINT fk_merchant_community
|
||||
FOREIGN KEY (community_id) REFERENCES communities(id)
|
||||
|
||||
|
||||
--====FINISH 3.24====
|
||||
BIN
jobs.sqlite
BIN
jobs.sqlite
Binary file not shown.
Loading…
Reference in New Issue
Block a user