x_shop_sets.gen.go 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Code generated by gorm.io/gen. DO NOT EDIT.
  2. // Code generated by gorm.io/gen. DO NOT EDIT.
  3. // Code generated by gorm.io/gen. DO NOT EDIT.
  4. package model
  5. import (
  6. "github.com/shopspring/decimal"
  7. "go_zh/config"
  8. "time"
  9. )
  10. const TableNameXShopSet = "x_shop_sets"
  11. // XShopSet mapped from table <x_shop_sets>
  12. type XShopSet struct {
  13. ID int `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
  14. ShopID int `gorm:"column:shop_id;not null;comment:店铺ID" json:"shop_id"` // 店铺ID
  15. Discount decimal.Decimal `gorm:"column:discount;not null;comment:折扣比列" json:"discount"` // 折扣比列
  16. ProvinceNum decimal.Decimal `gorm:"column:province_num;not null;comment:省级返佣比列" json:"province_num"` // 省级返佣比列
  17. CityNum decimal.Decimal `gorm:"column:city_num;not null;comment:市级返佣比列" json:"city_num"` // 市级返佣比列
  18. AreaNum decimal.Decimal `gorm:"column:area_num;not null;comment:区级返佣比列" json:"area_num"` // 区级返佣比列
  19. SalesNum decimal.Decimal `gorm:"column:sales_num;not null;comment:分销商返佣比列" json:"sales_num"` // 分销商返佣比列
  20. ShopNum decimal.Decimal `gorm:"column:shop_num;not null;comment:店铺返佣比列" json:"shop_num"` // 店铺返佣比列
  21. MemberNum decimal.Decimal `gorm:"column:member_num;not null;comment:会员公益豆获取比列" json:"member_num"` // 会员公益豆获取比列
  22. PurchasesNum decimal.Decimal `gorm:"column:purchases_num;not null;comment:进货金获取比列" json:"purchases_num"` // 进货金获取比列
  23. CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
  24. UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
  25. FansNum int `gorm:"column:fans_num;default:5000;comment:粉丝最大数量" json:"fans_num"` // 粉丝最大数量
  26. MemberCash decimal.Decimal `gorm:"column:member_cash;default:0.00;comment:会员返现比列" json:"member_cash"` // 会员返现比列
  27. ServiceNum decimal.Decimal `gorm:"column:service_num;not null;comment:交易手续费" json:"service_num"` // 交易手续费
  28. Performance decimal.Decimal `gorm:"column:performance;comment:业绩" json:"performance"` // 业绩
  29. IsBean int `gorm:"column:is_bean;comment:是否启用分销提成转化振合豆 0否1是" json:"is_bean"` // 是否启用分销提成转化振合豆 0否1是
  30. }
  31. // TableName XShopSet's table name
  32. func (*XShopSet) TableName() string {
  33. return TableNameXShopSet
  34. }
  35. //获取商户配置
  36. func (se *XShopSet) GetShopSetInfo(shopId int) (XShopSet, error) {
  37. shopSet := XShopSet{}
  38. model := config.Mdb.Model(shopSet).Where("shop_id = ?",shopId)
  39. if err := model.First(&shopSet).Error; err != nil {
  40. return shopSet,err
  41. }
  42. return shopSet, nil
  43. }