v4.0.9版本更新-门店分类支持多选
CI / verify (pull_request) Has been cancelled

This commit is contained in:
2026-09-02 11:12:51 +08:00
parent 77e9917a18
commit fe557c912d
18 changed files with 742 additions and 239 deletions
+18
View File
@@ -1000,12 +1000,29 @@ model CommonStoreCategory {
parent CommonStoreCategory? @relation("StoreCategoryTree", fields: [parentId], references: [id], onDelete: Restrict)
children CommonStoreCategory[] @relation("StoreCategoryTree")
stores Store[]
storeLinks StoreCategoryLink[]
@@index([parentId, sort])
@@index([status])
@@map("common_store_category")
}
/// 门店 ↔ 二级分类多对多;store.category_id 保留主分类(排序第一)
model StoreCategoryLink {
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
storeId BigInt @map("store_id") @db.UnsignedBigInt
categoryId BigInt @map("category_id") @db.UnsignedBigInt
priority Int @default(0)
createdAt DateTime @default(now()) @map("created_at") @db.DateTime(3)
store Store @relation(fields: [storeId], references: [id], onDelete: Cascade)
category CommonStoreCategory @relation(fields: [categoryId], references: [id], onDelete: Cascade)
@@unique([storeId, categoryId])
@@index([categoryId])
@@map("store_category_link")
}
model CommonPromoCode {
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
code String @unique @db.VarChar(32)
@@ -1542,6 +1559,7 @@ model Store {
packages StorePackage[]
packageChangeRequests StorePackageChangeRequest[]
infoChangeRequests StoreInfoChangeRequest[]
categoryLinks StoreCategoryLink[]
@@index([cityId, status])
@@index([partnerAccountId])