You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
916 B
35 lines
916 B
package jst
|
|
|
|
import (
|
|
"recook/internal/v2/lib/db"
|
|
)
|
|
|
|
// ShopModel 聚水潭用户和供应商关联.
|
|
type ShopModel struct {
|
|
db.BaseModel
|
|
ID uint `gorm:"column:id;primary_key"`
|
|
ShopID uint `gorm:"column:shop_id"`
|
|
PartnerID string `gorm:"column:partner_id"`
|
|
PartnerKey string `gorm:"column:partner_key"`
|
|
Token string `gorm:"column:token"`
|
|
GysUserID uint `gorm:"gys_user_id"`
|
|
Disable bool `gorm:"disable"`
|
|
}
|
|
|
|
// TableName sets the insert table name for this struct type.
|
|
func (r *ShopModel) TableName() string {
|
|
return "jst_shop"
|
|
}
|
|
|
|
// FindByGysUserID 根据GysUserID.
|
|
func (r *ShopModel) FindByGysUserID(by uint) (result ShopModel) {
|
|
r.GetDb().Model(&ShopModel{}).Where("gys_user_id = ?", by).First(&result)
|
|
return
|
|
}
|
|
|
|
// FindByID 根据ID.
|
|
func (r *ShopModel) FindByID(by uint) (result ShopModel) {
|
|
r.GetDb().Model(&ShopModel{}).Where("id = ?", by).First(&result)
|
|
return
|
|
}
|