- Store and StoreMap add DeletedAt.

This commit is contained in:
gazebo
2018-09-20 10:07:58 +08:00
parent f874c37d14
commit 9d88344ddb
14 changed files with 206 additions and 172 deletions

View File

@@ -112,9 +112,9 @@ func init() {
}
type Store struct {
ModelIDCUL
ModelIDCULD
Name string `orm:"size(255);unique" json:"name"`
Name string `orm:"size(255)" json:"name"`
CityCode int `orm:"default(0);null" json:"cityCode"` // todo ?
DistrictCode int `orm:"default(0);null" json:"districtCode"` // todo ?
Address string `orm:"size(255)" json:"address"`
@@ -133,8 +133,14 @@ type Store struct {
DeliveryType int8 `orm:"-" json:"-"`
}
func (*Store) TableUnique() [][]string {
return [][]string{
[]string{"Name", "DeletedAt"},
}
}
type StoreSub struct {
ModelIDCUL
ModelIDCULD
StoreID int `orm:"column(store_id)"`
Index int // 子店序号为0表示主店
@@ -148,12 +154,12 @@ type StoreSub struct {
func (*StoreSub) TableUnique() [][]string {
return [][]string{
[]string{"StoreID", "Index"},
[]string{"StoreID", "Index", "DeletedAt"},
}
}
type StoreMap struct {
ModelIDCUL
ModelIDCULD
StoreID int `orm:"column(store_id)" json:"storeID"`
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
@@ -170,13 +176,13 @@ type StoreMap struct {
func (*StoreMap) TableUnique() [][]string {
return [][]string{
[]string{"StoreID", "VendorID"},
[]string{"VendorStoreID", "VendorID"},
[]string{"StoreID", "VendorID", "DeletedAt"},
[]string{"VendorStoreID", "VendorID", "DeletedAt"},
}
}
type StoreCourierMap struct {
ModelIDCUL
ModelIDCULD
StoreID int `orm:"column(store_id)"`
VendorID int `orm:"column(vendor_id)"`
@@ -186,7 +192,7 @@ type StoreCourierMap struct {
func (*StoreCourierMap) TableUnique() [][]string {
return [][]string{
[]string{"StoreID", "VendorID"},
[]string{"VendorStoreID", "VendorID"},
[]string{"StoreID", "VendorID", "DeletedAt"},
[]string{"VendorStoreID", "VendorID", "DeletedAt"},
}
}