| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- // 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 (
- "time"
- "go_zh/config"
- "github.com/shopspring/decimal"
- )
- const TableNameXShop = "x_shops"
- // XShop mapped from table <x_shops>
- type XShop struct {
- ID int `gorm:"column:id;primaryKey;autoIncrement:true" json:"id"`
- ShopName string `gorm:"column:shop_name;not null;comment:店铺名称" json:"shop_name"` // 店铺名称
- ShopSn string `gorm:"column:shop_sn;not null;comment:店铺编号" json:"shop_sn"` // 店铺编号
- ShopPhone string `gorm:"column:shop_phone;not null;comment:店铺电话" json:"shop_phone"` // 店铺电话
- Shopkeeper string `gorm:"column:shopkeeper;not null;comment:店主姓名" json:"shopkeeper"` // 店主姓名
- ShopLogo string `gorm:"column:shop_logo;not null;comment:店铺logo" json:"shop_logo"` // 店铺logo
- ClassID int `gorm:"column:class_id;not null;comment:一级分类ID" json:"class_id"` // 一级分类ID
- ClassTwoID int `gorm:"column:class_two_id;not null;comment:二级分类ID" json:"class_two_id"` // 二级分类ID
- ProvinceID int `gorm:"column:province_id;not null;comment:省份ID" json:"province_id"` // 省份ID
- CityID int `gorm:"column:city_id;not null;comment:市ID" json:"city_id"` // 市ID
- AreaID int `gorm:"column:area_id;not null;comment:区ID" json:"area_id"` // 区ID
- StreetID int `gorm:"column:street_id;not null;comment:街道ID" json:"street_id"` // 街道ID
- CityName string `gorm:"column:city_name;not null;comment:城市名称" json:"city_name"` // 城市名称
- Address string `gorm:"column:address;not null;comment:详细地址" json:"address"` // 详细地址
- Status int `gorm:"column:status;not null;comment:状态,0:待审核,1:已通过,2:已关闭" json:"status"` // 状态,0:待审核,1:已通过,2:已关闭
- Type int `gorm:"column:type;not null;comment:类型:1:省代,2:市代,3:区代,4:分销商,5:店铺,6:自营店铺,7:厂家" json:"type"` // 类型:1:省代,2:市代,3:区代,4:分销商,5:店铺,6:自营店铺,7:厂家
- IsDel int `gorm:"column:is_del;not null;comment:是否删除" json:"is_del"` // 是否删除
- Lon float64 `gorm:"column:lon;not null;comment:经度" json:"lon"` // 经度
- Lat float64 `gorm:"column:lat;not null;comment:纬度" json:"lat"` // 纬度
- CreatedAt time.Time `gorm:"column:created_at" json:"created_at"`
- UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"`
- Sort int `gorm:"column:sort;not null;comment:排序" json:"sort"` // 排序
- ClassName string `gorm:"column:class_name;not null;comment:分类名称" json:"class_name"` // 分类名称
- ShopScore float64 `gorm:"column:shop_score;default:0.00;comment:评分" json:"shop_score"` // 评分
- CollectNum int `gorm:"column:collect_num;comment:收藏人数" json:"collect_num"` // 收藏人数
- ShopCode string `gorm:"column:shop_code;comment:推荐码" json:"shop_code"` // 推荐码
- ShopShareImg string `gorm:"column:shop_share_img;comment:店铺推荐图" json:"shop_share_img"` // 店铺推荐图
- MID int `gorm:"column:m_id;comment:绑定账户ID" json:"m_id"` // 绑定账户ID
- Sex bool `gorm:"column:sex;default:1;comment:性别" json:"sex"` // 性别
- RecomShopID int `gorm:"column:recom_shop_id;comment:推广店铺ID" json:"recom_shop_id"` // 推广店铺ID
- ShopMoney decimal.Decimal `gorm:"column:shop_money;default:0.0000;comment:店铺余额" json:"shop_money"` // 店铺余额
- PurchaseMoney decimal.Decimal `gorm:"column:purchase_money;default:0.00;comment:店铺进货金" json:"purchase_money"` // 店铺进货金
- LicenseSn string `gorm:"column:license_sn;not null;comment:营业执照编号" json:"license_sn"` // 营业执照编号
- PayImg string `gorm:"column:pay_img;comment:收款码" json:"pay_img"` // 收款码
- GoodsAudit bool `gorm:"column:goods_audit;comment:商品是否审核1需要审核 0不用审核" json:"goods_audit"` // 商品是否审核1需要审核 0不用审核
- Discount int `gorm:"column:discount;comment:店铺折扣" json:"discount"` // 店铺折扣
- AccreditIds string `gorm:"column:accredit_ids;comment:授权地址ids" json:"accredit_ids"` // 授权地址ids
- CodeImg string `gorm:"column:code_img;comment:店铺code图片地址" json:"code_img"` // 店铺code图片地址
- PayVoice bool `gorm:"column:pay_voice;default:1;comment:是否开启线下支付语音提醒 0否 1是" json:"pay_voice"` // 是否开启线下支付语音提醒 0否 1是
- OrderNotice bool `gorm:"column:order_notice;default:1;comment:是否开启新订单通知 0否 1是" json:"order_notice"` // 是否开启新订单通知 0否 1是
- BankMoney decimal.Decimal `gorm:"column:bank_money;default:0.00;comment:银联到账金额" json:"bank_money"` // 银联到账金额
- Openid string `gorm:"column:openid;comment:公众号id" json:"openid"` // 公众号id
- IsEquipment int `gorm:"column:is_equipment;comment:是否绑定设备" json:"is_equipment"` // 是否绑定设备
- IsMove int `gorm:"column:is_move;default:1;comment:实体门店还是移动商贩 1是实体门店 2是移动商贩" json:"is_move"` // 实体门店还是移动商贩 1是实体门店 2是移动商贩
- }
- // TableName XShop's table name
- func (*XShop) TableName() string {
- return TableNameXShop
- }
- // GetShopByMemberId 根据会员 ID 获取店铺信息
- func (s *XShop) GetShopByMemberId(memberId int) (*XShop, error) {
- shop := &XShop{}
- err := config.Mdb.Model(s).
- Where("m_id = ? AND is_del = ? AND status = ?", memberId, 0, 1).
- First(shop).Error
- return shop, err
- }
|