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.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
package user
import (
"github.com/golangkit/formatime"
"time"
)
const TheCodeUsed = 2
const TheCodeNotUsed = 1
// 推荐人的历史记录, 表有二义性, 即是用户推荐历史, 获得的升级码也在这里
type IntroHistory struct {
ID int64 ` gorm:"column:id" json:"id" `
IntroCode string ` gorm:"column:intro_code" json:"introCode" `
UserId uint ` gorm:"column:user_id" json:"userId" ` // 被推荐的用户, 而非 升级码拥有者
UpgradeCode string ` gorm:"column:upgrade_code" json:"upgradeCode" `
KeepCode string ` gorm:"column:keep_code" json:"keepCode" `
CodeType int64 ` gorm:"column:code_type" json:"codeType" `
GivenBy int64 ` gorm:"column:given_by" json:"givenBy" `
UpCodeUsed int8 ` gorm:"column:up_code_used" json:"upCodeUsed" ` //'1未使用, 2已使用'
CreatedAt time . Time ` gorm:"column:created_at" json:"createdAt" `
UseAt formatime . Second ` gorm:"column:use_at" json:"useAt" ` //使用时间
RoleLevel int ` json:"roleLevel" `
UseUserId uint ` json:"useUserId" `
UseType int ` json:"useType" `
}
const (
CodeUnuseForIntroHistory = 1
CodeUsedForIntroHistory = 2
)
func ( r * IntroHistory ) TableName ( ) string {
return "recook_intro_history"
}