This commit is contained in:
苏尹岚
2021-02-24 16:39:23 +08:00
parent aeeb13cd0b
commit 655300e414
2 changed files with 61 additions and 0 deletions

View File

@@ -801,3 +801,58 @@ func (*BrandStore) TableUnique() [][]string {
[]string{"Name"},
}
}
//门店账户收入
type StoreAcctIncome struct {
ModelIDCUL
StoreID int `orm:"column(store_id)" json:"storeID"` //门店ID
UserID string `orm:"column(user_id)" json:"userID"` //用户ID (谁消费的)
Type int `json:"type"` //收入类型
IncomePrice int `json:"incomePrice"` //收入金额
}
func (v *StoreAcctIncome) TableIndex() [][]string {
return [][]string{
[]string{"StoreID"},
[]string{"CreatedAt"},
}
}
//门店账户支出
type StoreAcctExpend struct {
ModelIDCUL
StoreID int `orm:"column(store_id)" json:"storeID"` //门店ID
UserID string `orm:"column(user_id)" json:"userID"` //用户ID (谁消费的)
Type int `json:"type"` //支出类型
ExpendPrice int `json:"expendPrice"` //支出金额
}
func (v *StoreAcctExpend) TableIndex() [][]string {
return [][]string{
[]string{"StoreID"},
[]string{"CreatedAt"},
}
}
//门店账单表
type StoreAcct struct {
ModelIDCULD
StoreID int `orm:"column(store_id)" json:"storeID"` //门店ID
AccountBalance int `json:"accountBalance"` //账户余额
}
func (v *StoreAcct) TableUnique() [][]string {
return [][]string{
[]string{"StoreID"},
}
}
func (v *StoreAcct) TableIndex() [][]string {
return [][]string{
[]string{"CreatedAt"},
[]string{"AccountBalance"},
}
}

View File

@@ -99,6 +99,12 @@ func Init() {
orm.RegisterModel(&model.UserRole{})
orm.RegisterModel(&model.Menu{})
orm.RegisterModel(&model.RoleMenu{})
//门店账单
orm.RegisterModel(&model.StoreAcct{})
orm.RegisterModel(&model.StoreAcctExpend{})
orm.RegisterModel(&model.StoreAcctIncome{})
// create table
orm.RunSyncdb("default", false, true)
}