// Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. // Code generated by gorm.io/gen. DO NOT EDIT. package model import ( "github.com/shopspring/decimal" "go_zh/config" "time" ) const TableNameXShopSet = "x_shop_sets" // XShopSet mapped from table type XShopSet struct { ID int `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"` ShopID int `gorm:"column:shop_id;not null;comment:店铺ID" json:"shop_id"` // 店铺ID Discount decimal.Decimal `gorm:"column:discount;not null;comment:折扣比列" json:"discount"` // 折扣比列 ProvinceNum decimal.Decimal `gorm:"column:province_num;not null;comment:省级返佣比列" json:"province_num"` // 省级返佣比列 CityNum decimal.Decimal `gorm:"column:city_num;not null;comment:市级返佣比列" json:"city_num"` // 市级返佣比列 AreaNum decimal.Decimal `gorm:"column:area_num;not null;comment:区级返佣比列" json:"area_num"` // 区级返佣比列 SalesNum decimal.Decimal `gorm:"column:sales_num;not null;comment:分销商返佣比列" json:"sales_num"` // 分销商返佣比列 ShopNum decimal.Decimal `gorm:"column:shop_num;not null;comment:店铺返佣比列" json:"shop_num"` // 店铺返佣比列 MemberNum decimal.Decimal `gorm:"column:member_num;not null;comment:会员公益豆获取比列" json:"member_num"` // 会员公益豆获取比列 PurchasesNum decimal.Decimal `gorm:"column:purchases_num;not null;comment:进货金获取比列" json:"purchases_num"` // 进货金获取比列 CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` FansNum int `gorm:"column:fans_num;default:5000;comment:粉丝最大数量" json:"fans_num"` // 粉丝最大数量 MemberCash decimal.Decimal `gorm:"column:member_cash;default:0.00;comment:会员返现比列" json:"member_cash"` // 会员返现比列 ServiceNum decimal.Decimal `gorm:"column:service_num;not null;comment:交易手续费" json:"service_num"` // 交易手续费 Performance decimal.Decimal `gorm:"column:performance;comment:业绩" json:"performance"` // 业绩 IsBean int `gorm:"column:is_bean;comment:是否启用分销提成转化振合豆 0否1是" json:"is_bean"` // 是否启用分销提成转化振合豆 0否1是 } // TableName XShopSet's table name func (*XShopSet) TableName() string { return TableNameXShopSet } //获取商户配置 func (se *XShopSet) GetShopSetInfo(shopId int) (XShopSet, error) { shopSet := XShopSet{} model := config.Mdb.Model(shopSet).Where("shop_id = ?",shopId) if err := model.First(&shopSet).Error; err != nil { return shopSet,err } return shopSet, nil }