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.
403 lines
16 KiB
403 lines
16 KiB
package vend
|
|
|
|
import (
|
|
"github.com/golangkit/formatime"
|
|
"github.com/shopspring/decimal"
|
|
"recook/internal/dbc"
|
|
"recook/internal/model/freight"
|
|
"recook/internal/model/goods"
|
|
)
|
|
|
|
const (
|
|
GysUsersThirdTypeWxApp = 1
|
|
)
|
|
|
|
type Information struct {
|
|
|
|
//ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
//Name string `gorm:"column:name" json:"name"` // 供应商名称
|
|
//BusinessLicenseNum string `gorm:"column:business_license_num" json:"businessLicenseNum"` // 营业执照号
|
|
//BusinessLicenseAddress string `gorm:"column:business_license_address" json:"businessLicenseAddress"` // 营业执照号详细地址
|
|
//EffectiveStartTime string `gorm:"column:effective_start_time" json:"effectiveStartTime"` // 营业执照有效期开始时间
|
|
//EffectiveEndTime string `gorm:"column:effective_end_time" json:"effectiveEndTime"` // 营业执照有效期结束时间 长期填写长期
|
|
//BusinessScope string `gorm:"column:business_scope" json:"businessScope"` // 经营范围
|
|
//LegalRepresentativeName string `gorm:"column:legal_representative_name" json:"legalRepresentativeName"` // 法人姓名
|
|
//LegalRepresentativeIdNum string `gorm:"column:legal_representative_id_num" json:"legalRepresentativeIdNum"` // 法人身份证号码
|
|
//CreatedAt formatime.Second `gorm:"column:created_at" json:"created_at"`
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
CreatedAt formatime.Second `gorm:"column:created_at" json:"created_at"`
|
|
Username string `gorm:"username" json:"username"`
|
|
Password string `gorm:"password" json:"-"`
|
|
IsState int `gorm:"-" json:"is_state" `
|
|
StateStr string `gorm:"-" json:"state_str"`
|
|
Status int `json:"status"`
|
|
EnterpriseState GysEnterpriseState `gorm:"-" json:"enterprise_state"`
|
|
EnterpriseStateUp GysEnterpriseState `gorm:"-" json:"enterprise_state_up"`
|
|
Name string `gorm:"-" json:"name"`
|
|
}
|
|
|
|
// TableName sets the insert table name for this struct type
|
|
func (r *Information) TableName() string {
|
|
//return "recook_vendor_info"
|
|
return "gys_users"
|
|
}
|
|
|
|
type GysUsers struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
CreatedAt formatime.Second `gorm:"column:created_at" json:"created_at"`
|
|
Username string `gorm:"username" json:"username"`
|
|
Password string `gorm:"password" json:"-"`
|
|
IsState int `gorm:"-" json:"is_state" `
|
|
StateStr string `gorm:"-" json:"state_str"`
|
|
Status int `json:"status"`
|
|
EnterpriseState GysEnterpriseState `gorm:"-" json:"enterprise_state"`
|
|
EnterpriseStateUp GysEnterpriseState `gorm:"-" json:"enterprise_state_up"`
|
|
Name string `gorm:"-" json:"name"`
|
|
GysCode string `json:"gys_code"`
|
|
IsInterior uint `json:"is_interior" json:"isInterior"`
|
|
Openid string `gorm:"column:openid" json:"openid"`
|
|
}
|
|
|
|
// TableName sets the insert table name for this struct type
|
|
func (r *GysUsers) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_users"
|
|
}
|
|
|
|
//searchById查询供应商资料通过id
|
|
func (r *GysUsers) SearchUserById(id uint) (rest GysUsers) {
|
|
dbc.DB.Table("gys_users").Where("id=?", id).First(&rest)
|
|
return
|
|
}
|
|
|
|
type GysUsersThird struct {
|
|
Id uint `gorm:"column:id;primary_key" json:"id"`
|
|
UserId uint `gorm:"column:user_id" json:"userId"`
|
|
Type int `gorm:"column:type" json:"type"`
|
|
Code string `gorm:"column:code" json:"code"`
|
|
CreatedAt formatime.Second `gorm:"column:created_at" json:"created_at"`
|
|
}
|
|
|
|
// TableName sets the insert table name for this struct type
|
|
func (r *GysUsersThird) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_users_third"
|
|
}
|
|
|
|
type GysEnterpriseState struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
ContactEmail string `json:"contact_email"`
|
|
ContactPhone string `json:"contact_phone"`
|
|
Recommended string `json:"recommended"`
|
|
RecommendedName string `json:"recommended_name"`
|
|
RecommendedPhone string `json:"recommended_phone"`
|
|
EnterpriseName string `json:"enterprise_name"`
|
|
RegistrationAddress int `json:"registration_address"`
|
|
Trade int `json:"trade"`
|
|
CompanyType int `json:"company_type"`
|
|
CompanyTypeInfo string `json:"company_type_info"`
|
|
Capital string `json:"capital"`
|
|
Currency string `json:"currency"`
|
|
BusinessStart string `json:"business_start"`
|
|
BusinessEnd string `json:"business_end"`
|
|
RegistrationProvince string `json:"registration_province"`
|
|
RegistrationCity string `json:"registration_city"`
|
|
RegistrationDistrict string `json:"registration_district"`
|
|
OperationProvince string `json:"operation_province"`
|
|
OperationCity string `json:"operation_city"`
|
|
OperationDistrict string `json:"operation_district"`
|
|
OperationAddress string `json:"operation_address"`
|
|
EnterpriseCode string `json:"enterprise_code"`
|
|
LicenseUrl string `json:"license_url"`
|
|
PayTaxes int `json:"pay_taxes"`
|
|
PaytaxesUrl string `json:"paytaxes_url"`
|
|
AccountUrl string `json:"account_url"`
|
|
LegalPerson string `json:"legal_person"`
|
|
LegalPersonCode string `json:"legal_person_code"`
|
|
LegalPersonUrl string `json:"legal_person_url"`
|
|
OverseasRegistration string `json:"overseas_registration"`
|
|
OverseasOperation string `json:"overseas_operation"`
|
|
OverseasOperationInfo string `json:"overseas_operation_info"`
|
|
OverseasCode string `json:"overseas_code"`
|
|
OverseasCodeUrl string `json:"overseas_code_url"`
|
|
OverseasAccountUrl string `json:"overseas_account_url"`
|
|
OverseasLegalPerson string `json:"overseas_legal_person"`
|
|
OverseasLegalPersonUrl string `json:"overseas_legal_person_url"`
|
|
State string `json:"state"`
|
|
StateInfo string `json:"state_info"`
|
|
ComitTime formatime.Second `json:"comit_time"`
|
|
UserID string `json:"user_id"`
|
|
BrandList []GysEnterpriseBrand `gorm:"-" json:"brand_list"`
|
|
SectorList []GysEnterpriseSector `gorm:"-" json:"sector_list"`
|
|
AdminUser string `json:"-"`
|
|
AdminDate formatime.Second
|
|
AdminID uint `json:"-"`
|
|
RegistrationDetailAddress string `json:"registration_detail_address"`
|
|
CompanyId uint `json:"companyId"`
|
|
Source uint `json:"source"`
|
|
TaxNumber string `json:"taxNumber"`
|
|
BankName string `json:"bankName"`
|
|
BankCode string `json:"bankCode"`
|
|
Address string `json:"address"`
|
|
ContractStart formatime.Second `json:"contractStart"`
|
|
ContractEnd formatime.Second `json:"contractEnd"`
|
|
Deposit decimal.Decimal `json:"deposit"`
|
|
Period int `json:"period"`
|
|
ContractNo string `json:"contractNo"`
|
|
Tel string `json:"tel"`
|
|
}
|
|
|
|
func (r *GysEnterpriseState) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_enterprise_state"
|
|
}
|
|
|
|
type GysEnterpriseBrand struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
Name string `json:"name"`
|
|
Category string `json:"category"`
|
|
CategoryId string `gorm:"column:category_id" json:"categoryId"`
|
|
Level uint `json:"level"`
|
|
LevelInfo string `json:"level_info"`
|
|
RegistrationStart string `json:"registration_start"`
|
|
RegistrationEnd string `json:"registration_end"`
|
|
AuthorizationStart string `json:"authorization_start"`
|
|
AuthorizationEnd string `json:"authorization_end"`
|
|
EnterpriseID uint `json:"enterprise_id"`
|
|
Special []GysEnterpriseSpecial `gorm:"-" json:"special"`
|
|
SbImg []GysEnterpriseImg `gorm:"-" json:"sb_img"`
|
|
PpImg []GysEnterpriseImg `gorm:"-" json:"pp_img"`
|
|
QtImg []GysEnterpriseImg `gorm:"-" json:"qt_img"`
|
|
AdminUser string `json:"-"`
|
|
AdminDate formatime.Second `json:"-"`
|
|
AdminID uint `json:"-"`
|
|
State string `json:"state"`
|
|
StateInfo string `json:"state_info"`
|
|
ComiteDate string `json:"comite_date"`
|
|
MainID uint `json:"main_id"`
|
|
Log string `json:"log"`
|
|
IsThis bool `gorm:"-"`
|
|
UserID uint `gorm:"column:user_id" json:"userId"`
|
|
}
|
|
|
|
func (r *GysEnterpriseBrand) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_enterprise_brand"
|
|
}
|
|
|
|
const (
|
|
Sector_Type_Sales = 1 // 业务联系人
|
|
Sector_Type_AfterSales = 2 // 售后联系人
|
|
Sector_Type_Account = 3 // 对账联系人
|
|
)
|
|
|
|
type GysEnterpriseSector struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
Name string `json:"name"`
|
|
Phone string `json:"phone"`
|
|
Email string `json:"email"`
|
|
Info string `json:"info"`
|
|
CodeUrl string `json:"code_url"`
|
|
ProveUrl string `json:"prove_url"`
|
|
Position string `json:"position"`
|
|
EnterpriseID uint `json:"enterprise_id"`
|
|
Type int `json:"type"`
|
|
}
|
|
|
|
func (r *GysEnterpriseSector) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_enterprise_sector"
|
|
}
|
|
|
|
type GysEnterpriseImg struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
Type int `json:"-"`
|
|
Url string `json:"url"`
|
|
BrandID uint `json:"-"`
|
|
Start int `json:"start"`
|
|
End int `json:"end"`
|
|
}
|
|
|
|
func (r *GysEnterpriseImg) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_enterprise_img"
|
|
}
|
|
|
|
type GysEnterpriseSpecial struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
Url string `json:"url"`
|
|
Start string `json:"start"`
|
|
End string `json:"end"`
|
|
BrandID string `json:"brand_id"`
|
|
}
|
|
|
|
func (r *GysEnterpriseSpecial) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_enterprise_special"
|
|
}
|
|
|
|
type GysAuthGroupAccess struct {
|
|
Uid string
|
|
GroupID int
|
|
}
|
|
|
|
func (r *GysAuthGroupAccess) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_auth_group_access"
|
|
}
|
|
|
|
type GysGoodsInfo struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
Brand uint
|
|
Title string
|
|
ViceTitle string
|
|
FirstCategoryId uint
|
|
SecondCategoryId uint
|
|
PublishStatus int
|
|
Freight uint
|
|
Weight decimal.Decimal
|
|
Hash string
|
|
CreatedAts string ` json:"CreatedAt"`
|
|
UpdatedAts string ` json:"UpdatedAt"`
|
|
UserID uint
|
|
GoodsSn string
|
|
InspectionUrl string
|
|
PermissionUrl string
|
|
OtherUrl string
|
|
NoInfo string
|
|
MainBranid uint
|
|
MainGoodsID uint
|
|
AdminUser string `json:"-"`
|
|
AdminDate formatime.Second
|
|
AdminDateQc formatime.Second
|
|
AdminUserQc string
|
|
AdminIDQc uint
|
|
GcStatus int
|
|
AdminDateYy formatime.Second
|
|
AdminUserYy string
|
|
AdminIDYy uint
|
|
QcStatus int
|
|
AdminID uint `json:"-"`
|
|
Main []GysGoodsMainPhoto `gorm:"-"`
|
|
User GysUsers `gorm:"-"`
|
|
StateInfo string `gorm:"-"`
|
|
SkuList []GysGoodsSku `gorm:"-"`
|
|
InfoImg []GysGoodsDetailPhoto `gorm:"-"`
|
|
InspectionImg []GysGoodsDetailPhoto `gorm:"-"`
|
|
OtherImg []GysGoodsDetailPhoto `gorm:"-"`
|
|
One goods.Category `gorm:"-"`
|
|
Two goods.Category `gorm:"-"`
|
|
FreightInfo freight.Information `gorm:"-"`
|
|
Active GysGoodsPromotionPhoto `gorm:"-"`
|
|
Video GysGoodsVideo `gorm:"-"`
|
|
BrandInfo goods.Brand `gorm:"-"`
|
|
Material string
|
|
GysBrandName GysEnterpriseBrand `gorm:"-"`
|
|
GysMainPhoto string `gorm:"-"`
|
|
GysGoodsStatusTxt string `gorm:"-"`
|
|
IsAbroad int
|
|
}
|
|
|
|
func (r *GysGoodsInfo) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_goods_info"
|
|
}
|
|
|
|
//通过id来查询供应商货品表信息
|
|
func (r *GysGoodsInfo) SearchById(id uint) (rest GysGoodsInfo) {
|
|
dbc.DB.Table("gys_goods_info").Where("id=?", id).Find(&rest)
|
|
return
|
|
}
|
|
|
|
type GysGoodsMainPhoto struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
GoodsId uint
|
|
Url string
|
|
Name string
|
|
IsMaster uint
|
|
OrderNo uint
|
|
Width uint
|
|
Height uint
|
|
}
|
|
|
|
func (r *GysGoodsMainPhoto) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_goods_main_photo"
|
|
}
|
|
|
|
type GysGoodsSku struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
GoodsId uint
|
|
Name string
|
|
CombineId string
|
|
PicUrl string
|
|
Code string
|
|
PurchasePrice float32
|
|
OriginalPrice float32
|
|
DiscountPrice float32
|
|
Inventory uint `json:"inventory"`
|
|
CommissionRate decimal.Decimal
|
|
Coupon float64
|
|
GoodsNum string
|
|
}
|
|
|
|
func (r *GysGoodsSku) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_goods_sku"
|
|
}
|
|
|
|
type GysGoodsDetailPhoto struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
GoodsId uint
|
|
Url string
|
|
Name string
|
|
OrderNo uint
|
|
Width uint
|
|
Height uint
|
|
Type int
|
|
}
|
|
|
|
func (r *GysGoodsDetailPhoto) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_goods_detail_photo"
|
|
}
|
|
|
|
type GysGoodsPromotionPhoto struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
GoodsId uint
|
|
Url string
|
|
Width uint
|
|
Height uint
|
|
}
|
|
|
|
func (r *GysGoodsPromotionPhoto) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_goods_promotion_photo"
|
|
}
|
|
|
|
type GysGoodsVideo struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
GoodsId uint
|
|
Thumbnail string
|
|
Url string
|
|
Duration uint
|
|
Size float64
|
|
}
|
|
|
|
func (r *GysGoodsVideo) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_goods_video"
|
|
}
|
|
|
|
type GysAttribute struct {
|
|
ID uint `gorm:"column:id;primary_key" json:"id"`
|
|
GoodsId uint
|
|
Name string
|
|
Value string
|
|
}
|
|
|
|
func (r *GysAttribute) TableName() string {
|
|
// return "recook_vendor_info"
|
|
return "gys_goods_attribute"
|
|
}
|