This commit is contained in:
邹宗楠
2022-08-19 10:46:12 +08:00
parent 035497d3ec
commit 75ad109b81
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package model
import "time"
type PrintBindStore struct {
ID int `orm:"column(id)" json:"id" db:"id"`
CreatedAt time.Time `orm:"type(datetime)" json:"created_at" db:"created_at"` // 创建时间
UpdatedAt time.Time `orm:"type(datetime)" json:"updated_at" db:"updated_at"` // 更新时间
StoreID int64 `orm:"type(int);size(11)" json:"store_id" db:"store_id"` // 门店id(为京西创建门店id)唯一
StoreName string `orm:"type(varchar);size(255)" json:"store_name" db:"store_name"` // 门店名称
StoreVendor int `orm:"type(int);size(2)" json:"store_vendor" db:"store_vendor"` // 门店平台
PrintNo string `orm:"type(varchar);size(32);index" json:"print_no" db:"print_no"` // 打印机编号
UserId string `orm:"type(varchar);size(125)" json:"user_id" db:"user_id"` // 打印机所属用户
StoreStatus int `orm:"type(int);size(2)" json:"store_status" db:"store_status"` // 门店状态
BindStatus int `orm:"type(int);size(2)" json:"bind_status" db:"bind_status"` // 绑定状态
}
func (v *PrintBindStore) TableUnique() [][]string {
return [][]string{
[]string{"StoreID"},
}
}
func (v *PrintBindStore) TableIndex() [][]string {
return [][]string{
[]string{"UserId", "PrintNo", "StoreID"},
[]string{"PrintNo", "StoreID"},
}
}

View File

@@ -23,6 +23,7 @@ func Init() {
orm.RegisterModel(&model.PrintBill{})
orm.RegisterModel(&model.OrderPay{})
orm.RegisterModel(&model.PrintBillRecord{})
orm.RegisterModel(&model.PrintBindStore{})
// create table
orm.RunSyncdb("default", false, true)
}