x_shops.gen.go 6.9 KB

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