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