x_shop_mchids.gen.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. "go_zh/config"
  7. "time"
  8. )
  9. const TableNameXShopMchid = "x_shop_mchids"
  10. // XShopMchid mapped from table <x_shop_mchids>
  11. type XShopMchid struct {
  12. ID int `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
  13. ShopID int `gorm:"column:shop_id;not null" json:"shop_id"`
  14. SubMchid string `gorm:"column:sub_mchid;not null;comment:商户-商户号" json:"sub_mchid"` // 商户-商户号
  15. Type int `gorm:"column:type;default:1;comment:1微信 2支付宝 3银联" json:"type"` // 1微信 2支付宝 3银联
  16. IsDel int `gorm:"column:is_del;comment:是否删除 0:否,1:是" json:"is_del"` // 是否删除 0:否,1:是
  17. CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
  18. UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
  19. Enterprise string `gorm:"column:enterprise;comment:银联 企业用户号" json:"enterprise"` // 银联 企业用户号
  20. Tid string `gorm:"column:tid;comment:银联 终端编号" json:"tid"` // 银联 终端编号
  21. }
  22. // TableName XShopMchid's table name
  23. func (*XShopMchid) TableName() string {
  24. return TableNameXShopMchid
  25. }
  26. //获取商户银联信息
  27. func (*XShopMchid) GetShopBankMchid(shopId int) (XShopMchid, error) {
  28. mchidInfo := XShopMchid{}
  29. model := config.Mdb.Model(mchidInfo).Where("shop_id = ? AND is_del = ? AND type = ?",shopId,0,3)
  30. if err := model.Find(&mchidInfo).Error; err != nil {
  31. return mchidInfo,err
  32. }
  33. return mchidInfo, nil
  34. }