|
|
|
|
package common
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
ActivityID = iota + 10000
|
|
|
|
|
ActivityIDRecharge // 首充活动
|
|
|
|
|
ActivityIDAppSpin // 下载转盘活动
|
|
|
|
|
ActivityIDPDD // pdd活动
|
|
|
|
|
ActivityIDFreeSpin // 每日免费转盘
|
|
|
|
|
ActivityIDFirstRechargeBack // 首日充值返还
|
|
|
|
|
ActivityIDLuckyCode // 幸运码活动
|
|
|
|
|
ActivityIDSign // 签到活动
|
|
|
|
|
ActivityIDBreakGift // 破产礼包
|
|
|
|
|
ActivityIDWeekCard // 周卡
|
|
|
|
|
ActivityIDSlots // slots奖池活动
|
|
|
|
|
ActivityIDLuckyShop // 幸运商店活动
|
|
|
|
|
ActivityIDSevenDayBox // 7日签到宝箱
|
|
|
|
|
ActivityIDSuper // 超级1+2
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
ActivityDataZero = iota
|
|
|
|
|
ActivityDataClick
|
|
|
|
|
ActivityDataJoin
|
|
|
|
|
ActivityDataAll
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ConfigBanner banner配置
|
|
|
|
|
type ConfigBanner struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"ID" web:"id"`
|
|
|
|
|
ActivityID int `gorm:"column:activity_id;uniqueIndex:activity_id" json:"ActivityID" web:"activity_id"`
|
|
|
|
|
Sort int `gorm:"column:sort;type:int(11);" json:"Sort" web:"sort"`
|
|
|
|
|
Start int64 `gorm:"column:start;type:bigint(20);" json:"Start" web:"start"`
|
|
|
|
|
End int64 `gorm:"column:end;type:bigint(20);" json:"End" web:"end"`
|
|
|
|
|
IsRelease int `gorm:"column:is_release;type:int(11);default:1;comment:是否开启 1关闭 2开启" json:"IsRelease" web:"is_release"`
|
|
|
|
|
Push int `gorm:"column:push;type:int(11);default:1;comment:是否推送 1不推送 2推送" json:"Push" web:"push"`
|
|
|
|
|
PushFrequency int `gorm:"column:push_frequency;type:int(11);default:1;comment:推送频率" json:"PushFrequency" web:"push_frequency"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:1;comment:类型" json:"Type" web:"type"`
|
|
|
|
|
Pic string `gorm:"column:pic;type:varchar(255);comment:活动图片" json:"Pic" web:"pic"`
|
|
|
|
|
Data string `gorm:"column:data;type:varchar(255);comment:跳转数据" json:"Data" web:"data"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigBanner) TableName() string {
|
|
|
|
|
return "config_banner"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (s *ConfigBanner) IsValid() bool {
|
|
|
|
|
now := time.Now().Unix()
|
|
|
|
|
if s.IsRelease != 2 || s.Start > now || (s.End < now && s.End > 0) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ConfigActivity
|
|
|
|
|
type ConfigActivity struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"ID" web:"id"`
|
|
|
|
|
ActivityID int `gorm:"column:activity_id;uniqueIndex:activity_id" json:"ActivityID" web:"activity_id"`
|
|
|
|
|
Sort int `gorm:"column:sort;type:int(11);" json:"Sort" web:"sort"`
|
|
|
|
|
Start int64 `gorm:"column:start;type:bigint(20);" json:"Start" web:"start"`
|
|
|
|
|
End int64 `gorm:"column:end;type:bigint(20);" json:"End" web:"end"`
|
|
|
|
|
IsRelease int `gorm:"column:is_release;type:int(11);default:1;comment:是否开启 1关闭 2开启" json:"IsRelease" web:"is_release"`
|
|
|
|
|
Push int `gorm:"column:push;type:int(11);default:1;comment:是否推送 1推送 2不推送" json:"Push" web:"push"`
|
|
|
|
|
PushFrequency int `gorm:"column:push_frequency;type:int(11);default:1;comment:推送频率" json:"PushFrequency" web:"push_frequency"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:1;comment:类型" json:"Type" web:"type"`
|
|
|
|
|
Pic string `gorm:"column:pic;type:varchar(255);comment:活动图片" json:"Pic" web:"pic"`
|
|
|
|
|
Data string `gorm:"column:data;type:varchar(255);comment:跳转数据" json:"Data" web:"data"`
|
|
|
|
|
Content string `gorm:"column:content;type:varchar(255);comment:文案内容" json:"Content" web:"content"`
|
|
|
|
|
Text string `gorm:"column:text;type:varchar(255);comment:按钮内容" json:"Text" web:"text"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *ConfigActivity) TableName() string {
|
|
|
|
|
return "config_activity"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Expire 判断活动是否可用
|
|
|
|
|
func (s *ConfigActivity) IsValid() bool {
|
|
|
|
|
now := time.Now().Unix()
|
|
|
|
|
if s.IsRelease != 2 || s.Start > now || (s.End < now && s.End > 0) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type PddData struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
UID int `gorm:"column:uid;not null;type:int(11);uniqueIndex:uid"`
|
|
|
|
|
Time int64 `gorm:"column:time;type:bigint(20);comment:创建时间"`
|
|
|
|
|
Amount int64 `gorm:"column:amount;type:bigint(20);comment:当前金额"`
|
|
|
|
|
Spin int `gorm:"column:spin;type:int(11);comment:剩余旋转次数"`
|
|
|
|
|
FreeSpinTime int64 `gorm:"column:free_spin_time;type:bigint(20);comment:免费旋转时间"`
|
|
|
|
|
NewRecordTime int64 `gorm:"column:new_record_time;type:bigint(20);comment:判断新邀请用户标记时间"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (a *PddData) TableName() string {
|
|
|
|
|
return "pdd_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 拼多多活动转盘物品类型
|
|
|
|
|
const (
|
|
|
|
|
ActivityPddItemType = iota
|
|
|
|
|
ActivityPddItemTypeFinish // 直接补齐差额
|
|
|
|
|
ActivityPddItemTypeCash // 固定金额
|
|
|
|
|
ActivityPddItemTypeRandomCash // 随机金额
|
|
|
|
|
ActivityPddItemTypeAll
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ConfigActivityPddSpin 拼多多分享活动转盘配置
|
|
|
|
|
type ConfigActivityPddSpin struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"ID"`
|
|
|
|
|
AmountDown int64 `gorm:"column:amount_down;type:bigint(20);default:0;uniqueIndex:amount_sort;comment:区间金额下限" web:"amount_down"`
|
|
|
|
|
AmountUp int64 `gorm:"column:amount_up;type:bigint(20);default:0;comment:区间金额上限" web:"amount_up"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:3;comment:物品类型" web:"type"`
|
|
|
|
|
Amount int64 `gorm:"column:amount;type:bigint(20);default:0;comment:物品数量" web:"amount"`
|
|
|
|
|
Weight int `gorm:"column:weight;type:int(11);default:0;comment:权重" web:"weight"`
|
|
|
|
|
Sort int `gorm:"column:sort;type:int(11);default:0;uniqueIndex:amount_sort;comment:排序" web:"sort"`
|
|
|
|
|
CashDown int64 `gorm:"column:cash_down;type:bigint(20);default:0;comment:当type是随机金额的时候,表示随机金额的下限" web:"cash_down"`
|
|
|
|
|
CashUp int64 `gorm:"column:cash_up;type:bigint(20);default:0;comment:当type是随机金额的时候,表示随机金额的上限" web:"cash_up"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivityPddSpin) TableName() string {
|
|
|
|
|
return "config_activity_pdd_spin"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ConfigActivityPdd 拼多多分享活动配置
|
|
|
|
|
type ConfigActivityPdd struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id"`
|
|
|
|
|
WithdrawAmount int64 `gorm:"column:withdraw_amount;type:bigint(20);default:0;comment:可退出门槛" web:"withdraw_amount"`
|
|
|
|
|
AmountDown int64 `gorm:"column:amount_down;type:bigint(20);default:0;comment:随机金额下限" web:"amount_down"`
|
|
|
|
|
AmountUp int64 `gorm:"column:amount_up;type:bigint(20);default:0;comment:随机金额上限" web:"amount_up"`
|
|
|
|
|
Expire int64 `gorm:"column:expire;type:bigint(20);default:0;comment:过期时间,单位分钟" web:"expire"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivityPdd) TableName() string {
|
|
|
|
|
return "config_activity_pdd"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ConfigFirstPay 首充奖励配置
|
|
|
|
|
type ConfigFirstPay struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id"`
|
|
|
|
|
Level int `gorm:"column:level;type:int(11);default:0;comment:等级" web:"level"`
|
|
|
|
|
Amount int64 `gorm:"column:amount;type:bigint(20);default:0;comment:充值额度" web:"amount"`
|
|
|
|
|
FirstPer int64 `gorm:"column:first_per;type:bigint(20);default:0;comment:首次充值赠送比例,百分位" web:"first_per"`
|
|
|
|
|
Per int64 `gorm:"column:per;type:bigint(20);default:0;comment:后续充值赠送比例,百分位" web:"per"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigFirstPay) TableName() string {
|
|
|
|
|
return "config_first_pay"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ConfigActivityFreeSpin 每日免费转盘配置
|
|
|
|
|
type ConfigActivityFreeSpin struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"ID"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:3;comment:物品类型,对应枚举" web:"type"`
|
|
|
|
|
Amount int64 `gorm:"column:amount;type:bigint(20);default:0;comment:物品数量" web:"amount"`
|
|
|
|
|
Weight int `gorm:"column:weight;type:int(11);default:0;comment:权重" web:"weight"`
|
|
|
|
|
Sort int `gorm:"column:sort;type:int(11);default:0;uniqueIndex:amount_sort;comment:排序" web:"sort"`
|
|
|
|
|
CashDown int64 `gorm:"column:cash_down;type:bigint(20);default:0;comment:当type是随机金额的时候,表示随机金额的下限" web:"cash_down"`
|
|
|
|
|
CashUp int64 `gorm:"column:cash_up;type:bigint(20);default:0;comment:当type是随机金额的时候,表示随机金额的上限" web:"cash_up"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivityFreeSpin) TableName() string {
|
|
|
|
|
return "config_activity_free_spin"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 拼多多活动转盘物品类型
|
|
|
|
|
const (
|
|
|
|
|
ActivityFreeSpinItem = iota
|
|
|
|
|
ActivityFreeSpinItemNone // 转到无奖励
|
|
|
|
|
ActivityFreeSpinItemCash // 固定金额
|
|
|
|
|
ActivityFreeSpinItemRandomCash // 随机金额
|
|
|
|
|
ActivityFreeSpinItemDoubleCash // 双倍奖励
|
|
|
|
|
ActivityFreeSpinItemAll
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ActivityFreeSpinData
|
|
|
|
|
type ActivityFreeSpinData struct {
|
|
|
|
|
UID int `gorm:"column:uid;not null;type:int(11);uniqueIndex:uid"`
|
|
|
|
|
LastSpin int64 `gorm:"column:last_spin;default:0;type:bigint(20);comment:上次旋转时间"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivityFreeSpinData) TableName() string {
|
|
|
|
|
return "activity_free_spin_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 首次充值后判断间隔
|
|
|
|
|
const (
|
|
|
|
|
ActivityFirstRechargeBackTime = 86400 // 一天
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// ConfigActivityFirstRechargeBack 首日充值返还
|
|
|
|
|
type ConfigActivityFirstRechargeBack struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id" json:"ID"`
|
|
|
|
|
MinRecharge int64 `gorm:"column:min_recharge;type:bigint(20);default:10000000000;comment:最低充值额度" web:"min_recharge"`
|
|
|
|
|
MaxBack int64 `gorm:"column:max_back;type:bigint(20);default:-1;comment:最大返还额度" web:"max_back"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivityFirstRechargeBack) TableName() string {
|
|
|
|
|
return "config_activity_first_recharge_back"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ActivityFirstRechargeBackData struct {
|
|
|
|
|
UID int `gorm:"column:uid;not null;type:int(11);uniqueIndex:uid"`
|
|
|
|
|
RechargeTime int64 `gorm:"column:recharge_time;type:bigint(20);default:0;comment:首次充值时间"`
|
|
|
|
|
Amount int64 `gorm:"column:amount;type:bigint(20);default:0;comment:总充值金额"`
|
|
|
|
|
Lost int64 `gorm:"column:lost;type:bigint(20);default:0;comment:活动时间内总损失"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivityFirstRechargeBackData) TableName() string {
|
|
|
|
|
return "activity_first_recharge_back_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
LuckyCodeTypeZero = iota
|
|
|
|
|
LuckyCodeTypeNormal
|
|
|
|
|
LuckyCodeTypeAll
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ConfigActivityLuckyCode struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:1;comment:类型" web:"type"`
|
|
|
|
|
Reward int64 `gorm:"column:reward;not null;type:bigint(20);comment:奖励的物品" web:"reward"`
|
|
|
|
|
Per int64 `gorm:"column:per;type:int(11);default:60;comment:奖品的权重" web:"per"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivityLuckyCode) TableName() string {
|
|
|
|
|
return "config_activity_lucky_code"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ActivityLuckyCodeData struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id"`
|
|
|
|
|
Type int `gorm:"column:type;default:1;type:int(11);"`
|
|
|
|
|
UID int `gorm:"column:uid;not null;type:int(11);uniqueIndex:uid"`
|
|
|
|
|
LastDraw int64 `gorm:"column:last_draw;default:0;type:bigint(20)"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivityLuckyCodeData) TableName() string {
|
|
|
|
|
return "activity_lucky_code_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 存放每天的兑换码记录
|
|
|
|
|
type ActivityLuckyCode struct {
|
|
|
|
|
ID int `gorm:"primary_key;AUTO_INCREMENT;column:id"`
|
|
|
|
|
Type int `gorm:"column:type;default:1;type:int(11);"`
|
|
|
|
|
Code int `gorm:"column:code;default:0;type:int(11)"`
|
|
|
|
|
Date string `gorm:"column:date;default:'';type:varchar(64);uniqueIndex:date;comment:日期"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivityLuckyCode) TableName() string {
|
|
|
|
|
return "activity_lucky_code"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ConfigActivitySign struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
Day int `gorm:"column:day;type:int(11);default:1;comment:签到天数" web:"day"`
|
|
|
|
|
Reward int64 `gorm:"column:reward;not null;type:bigint(20);comment:奖励" web:"reward"`
|
|
|
|
|
Recharge int64 `gorm:"column:recharge;type:bigint(20);default:0;comment:所需充值金额" web:"recharge"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivitySign) TableName() string {
|
|
|
|
|
return "config_activity_sign"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ActivitySignData struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
UID int `gorm:"column:uid;type:int(11);uniqueIndex:uid"`
|
|
|
|
|
Sign int `gorm:"column:sign;type:int(11);comment:签到天数,二进制"`
|
|
|
|
|
Time int64 `gorm:"column:time;type:bigint(20);comment:首次参与时间"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivitySignData) TableName() string {
|
|
|
|
|
return "activity_sign_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ConfigActivityBreakGift struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
Level int `gorm:"column:level;type:int(11);default:1;comment:等级" web:"level"`
|
|
|
|
|
RechargeDown int64 `gorm:"column:recharge_down;type:bigint(11);default:1000000000;comment:充值金额下限" web:"recharge_down"`
|
|
|
|
|
RechargeUp int64 `gorm:"column:recharge_up;type:bigint(20);default:2000000000;comment:充值金额上限" web:"recharge_up"`
|
|
|
|
|
CountDown int `gorm:"column:count_down;type:int(11);default:30;comment:倒计时" web:"count_down"`
|
|
|
|
|
ProductID int `gorm:"column:product_id;type:int(11);default:0;comment:商品id" web:"product_id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivityBreakGift) TableName() string {
|
|
|
|
|
return "config_activity_break_gift"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ConfigActivityWeekCard struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
Level int `gorm:"column:level;type:int(11);default:1;comment:等级" web:"level"`
|
|
|
|
|
ProductID int `gorm:"column:product_id;type:int(11);default:0;comment:商品id" web:"product_id"`
|
|
|
|
|
DayReward int64 `gorm:"column:day_reward;type:bigint(11);default:700000000;comment:每日可领取奖励" web:"day_reward"`
|
|
|
|
|
OriginPrice int64 `gorm:"column:origin_price;type:bigint(11);default:5000000000;comment:显示的原价" web:"origin_price"`
|
|
|
|
|
Day int `gorm:"column:day;type:int(11);default:6;comment:可领取天数" web:"day"`
|
|
|
|
|
Discount int `gorm:"column:discount;type:int(11);default:70;comment:折扣率,百分位" web:"discount"`
|
|
|
|
|
Rebate int `gorm:"column:rebate;type:int(11);default:240;comment:返利率,百分位" web:"rebate"`
|
|
|
|
|
Range string `gorm:"column:range;default:'[2000000000,100000000000]';type:varchar(255);comment:充值可用范围"`
|
|
|
|
|
SubRange []int64 `gorm:"-" json:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivityWeekCard) TableName() string {
|
|
|
|
|
return "config_activity_week_card"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
ActivityWeekCardTicketExpireTime = 48 * 3600 // 两个小时
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ActivityWeekCardData struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
UID int `gorm:"column:uid;type:int(11);uniqueIndex:ul"`
|
|
|
|
|
Level int `gorm:"column:level;type:int(11);default:0;uniqueIndex:ul;comment:周卡等级"`
|
|
|
|
|
DayReward int64 `gorm:"column:day_reward;type:bigint(11);default:700000000;comment:每日可领取奖励"`
|
|
|
|
|
Day int `gorm:"column:day;type:int(11);default:6;comment:可领取天数"`
|
|
|
|
|
LastDraw int64 `gorm:"column:last_draw;type:bigint(20);default:0;comment:上次领取时间"`
|
|
|
|
|
GetDiscount int `gorm:"column:get_discount;type:tinyint(4);default:0;comment:前面是否已经获得了折扣券"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivityWeekCardData) TableName() string {
|
|
|
|
|
return "activity_week_card_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 支付时带有一些信息,如折扣券,赋值在recharge_order的extra字段
|
|
|
|
|
type ActivityRechargeData struct {
|
|
|
|
|
ID int `json:"ID,omitempty"` // 活动id
|
|
|
|
|
I1 int `json:"I1,omitempty"` // 携带的信息1,不同活动可能含义不同,折扣券活动代表折扣券等级
|
|
|
|
|
I2 int64 `json:"I2,omitempty"` // 携带信息2,不同活动可能含义不同,折扣券活动代表实际发放金额
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ConfigActivitySlots struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
RankDown int `gorm:"column:rank_down;type:int(11);default:1;comment:排名下限" web:"rank_down"`
|
|
|
|
|
RankUp int `gorm:"column:rank_up;type:int(11);default:1;comment:排名上限" web:"rank_up"`
|
|
|
|
|
Reward int64 `gorm:"column:reward;type:bigint(11);default:99900000000;comment:奖励" web:"reward"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivitySlots) TableName() string {
|
|
|
|
|
return "config_activity_slots"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 1,2通过对当天日期取余决定
|
|
|
|
|
type ActivitySlotsData struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
UID int `gorm:"column:uid;type:int(11);uniqueIndex:uid"`
|
|
|
|
|
Avatar string `gorm:"column:avatar;default:'';type:varchar(255);comment:头像"`
|
|
|
|
|
Nick string `gorm:"column:nick;default:'';type:varchar(255);comment:昵称"`
|
|
|
|
|
Spin int `gorm:"column:spin;type:int(11);default:0;comment:抽奖次数"`
|
|
|
|
|
BestNumber1 int `gorm:"column:best_number1;type:int(11);default:0;comment:抽到的最大的数字1"`
|
|
|
|
|
Time1 int64 `gorm:"column:time1;type:bigint(20);comment:参与时间1"`
|
|
|
|
|
BestNumber2 int `gorm:"column:best_number2;type:int(11);default:0;comment:抽到的最大的数字2"`
|
|
|
|
|
Time2 int64 `gorm:"column:time2;type:bigint(20);comment:参与时间2"`
|
|
|
|
|
Role int `gorm:"column:role;type:int(11);default:0;comment:角色,1代表机器人,2初始默认的机器人"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivitySlotsData) TableName() string {
|
|
|
|
|
return "activity_slots_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 结算记录
|
|
|
|
|
type ActivitySlotsRecord struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
Date string `gorm:"column:date;default:'';type:varchar(255);uniqueIndex:du;comment:日期"`
|
|
|
|
|
UID int `gorm:"column:uid;type:int(11);uniqueIndex:du"`
|
|
|
|
|
Settle int `gorm:"column:settle;type:int(11);default:0;comment:是否结算,1代表已结算"`
|
|
|
|
|
BestNumber int `gorm:"column:best_number;type:int(11);default:0;comment:当日的最大的数字"`
|
|
|
|
|
Reward int64 `gorm:"column:reward;type:bigint(20);default:0;comment:奖励" web:"reward"`
|
|
|
|
|
MyNumber int `gorm:"column:my_number;type:int(11);default:0;comment:玩家的数字"`
|
|
|
|
|
Rank int `gorm:"column:rank;type:int(11);default:0;comment:排名"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivitySlotsRecord) TableName() string {
|
|
|
|
|
return "activity_slots_Record"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
ActivityLuckyShopType = iota
|
|
|
|
|
ActivityLuckyShopTypeRechargeLess
|
|
|
|
|
ActivityLuckyShopTypeRechargeMore
|
|
|
|
|
ActivityLuckyShopTypeLogin
|
|
|
|
|
ActivityLuckyShopTypeAll
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ConfigActivityLuckyShop struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:1;comment:类型,1是首充小于弹出,2是首充大于弹出,3是付费玩家登录弹出" web:"type"`
|
|
|
|
|
Recharge int64 `gorm:"column:recharge;type:bigint(20);default:2000000000;comment:首充玩家弹出的充值额度" web:"recharge"`
|
|
|
|
|
ProductID int `gorm:"column:product_id;type:int(11);default:0;comment:商品id" web:"product_id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivityLuckyShop) TableName() string {
|
|
|
|
|
return "config_activity_lucky_shop"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
ActivityLuckyShopExpire = 2 * 3600 // 2小时过期
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ActivityLuckyShopData struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
UID int `gorm:"column:uid;not null;type:int(11);uniqueIndex:ut"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:1;uniqueIndex:ut;comment:类型,1是首充小于弹出,2是首充大于弹出,3是付费玩家登录弹出"`
|
|
|
|
|
Push int64 `gorm:"column:push;type:bigint(20);default:0;comment:弹窗弹出时间"`
|
|
|
|
|
Buy int `gorm:"column:buy;type:tinyint(4);default:0;comment:前面是否已经完成购买"`
|
|
|
|
|
ProductID int `gorm:"column:product_id;type:int(11);default:0;comment:商品id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivityLuckyShopData) TableName() string {
|
|
|
|
|
return "activity_lucky_shop_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivityLuckyShopData) IsValid() bool {
|
|
|
|
|
if c.Buy == 1 {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
return time.Now().Unix()-c.Push < ActivityLuckyShopExpire
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
ActivitySevenDayBoxType = iota
|
|
|
|
|
ActivitySevenDayBoxTypeCash
|
|
|
|
|
ActivitySevenDayBoxTypeDiscountTicket
|
|
|
|
|
ActivitySevenDayBoxTypeAll
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type ConfigActivitySevenDayBox struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
Recharge int64 `gorm:"column:recharge;type:bigint(20);default:10000000000;comment:充值额度" web:"recharge"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:1;comment:奖励类型 1金币 2折扣券" web:"type"`
|
|
|
|
|
CashRange string `gorm:"column:cash_range;type:varchar(255);default:[1000000000,2000000000];comment:随机金币范围,当type为1时有用" web:"cash_range"`
|
|
|
|
|
Discount int `gorm:"column:discount;type:int(11);default:70;comment:折扣,type为2时有用" web:"discount"`
|
|
|
|
|
Per int `gorm:"column:per;type:int(11);default:60;comment:概率" web:"per"`
|
|
|
|
|
SubCashRange []int64 `gorm:"-" json:"-"`
|
|
|
|
|
ProductID int `gorm:"column:product_id;type:int(11);default:0;comment:商品id" web:"product_id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivitySevenDayBox) TableName() string {
|
|
|
|
|
return "config_activity_seven_day_box"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ActivitySevenDayBoxData struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
UID int `gorm:"column:uid;not null;type:int(11);uniqueIndex:uid"`
|
|
|
|
|
Count int `gorm:"column:count;type:int(11);default:0;comment:剩余开宝箱次数" web:"count"`
|
|
|
|
|
Time int64 `gorm:"column:time;type:bigint(20);comment:购买时间"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivitySevenDayBoxData) TableName() string {
|
|
|
|
|
return "activity_seven_day_box_data"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ConfigActivitySuper struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
Type int `gorm:"column:type;type:int(11);default:1;comment:类型 1新用户 2老用户" web:"type"`
|
|
|
|
|
Recharge int64 `gorm:"column:recharge;type:bigint(20);default:20000000000;comment:充值额度" web:"recharge"`
|
|
|
|
|
Index int `gorm:"column:index;type:int(11);default:1;comment:奖池编号" web:"index"`
|
|
|
|
|
RewardType int `gorm:"column:reward_type;type:bigint(20);default:1;comment:奖励的类型 1金币 2折扣券" web:"reward_type"`
|
|
|
|
|
Reward int64 `gorm:"column:reward;default:0;type:bigint(20);comment:奖励的物品数量(折扣券时为折扣数额)" web:"reward"`
|
|
|
|
|
Sort int `gorm:"column:sort;type:int(11);default:0;comment:排序" web:"sort"`
|
|
|
|
|
Per int `gorm:"column:per;type:int(11);default:60;comment:概率" web:"per"`
|
|
|
|
|
ProductID int `gorm:"column:product_id;type:int(11);default:0;comment:商品id" web:"product_id"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ConfigActivitySuper) TableName() string {
|
|
|
|
|
return "config_activity_super"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type ActivitySuperData struct {
|
|
|
|
|
ID int `gorm:"primarykey"`
|
|
|
|
|
UID int `gorm:"column:uid;not null;type:int(11);uniqueIndex:uid"`
|
|
|
|
|
Open int `gorm:"column:open;default:0;type:int(11);comment:箱子开启情况,二进制"`
|
|
|
|
|
Time int64 `gorm:"column:time;type:bigint(20);comment:购买时间"`
|
|
|
|
|
Type int `gorm:"-"`
|
|
|
|
|
CanBuy bool `gorm:"-"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *ActivitySuperData) TableName() string {
|
|
|
|
|
return "activity_super_data"
|
|
|
|
|
}
|