|
@@ -73,9 +73,11 @@ func init() {
|
|
|
// InActivity 是否在活动时间内
|
|
|
// bTime 是否在预热时间段内
|
|
|
// iTime 是否在正式活动时间内
|
|
|
-func (BP *JyActivity) InActivity() (bTime, iTime bool) {
|
|
|
+// aTime 是否在全部活动时间内
|
|
|
+func (BP *JyActivity) InActivity() (bTime, iTime, aTime bool) {
|
|
|
now := time.Now()
|
|
|
bTime = now.After(MembershipDay.T1) && now.Before(MembershipDay.T2)
|
|
|
+ aTime = now.After(MembershipDay.T1) && now.Before(MembershipDay.Ed)
|
|
|
if bTime {
|
|
|
return
|
|
|
}
|
|
@@ -122,7 +124,7 @@ func (BP *JyActivity) GetScheduleQuery(userId string, schedule int) (status int)
|
|
|
|
|
|
// ScheduleGiven 活动任务进度奖励
|
|
|
func (BP *JyActivity) ScheduleGiven(userId string, schedule int) error {
|
|
|
- if _, inActivity := BP.InActivity(); !inActivity {
|
|
|
+ if _, inActivity, _ := BP.InActivity(); !inActivity {
|
|
|
return fmt.Errorf("不在活动时间内")
|
|
|
}
|
|
|
if BP.GetScheduleQuery(userId, schedule) != 1 {
|
|
@@ -195,7 +197,7 @@ func (BP *JyActivity) MissionsSVipBuyQuery(userId string) (status int) {
|
|
|
|
|
|
// MissionsSVipBuyGiven 订阅任务领取奖励
|
|
|
func (BP *JyActivity) MissionsSVipBuyGiven(userId string) error {
|
|
|
- if _, inActivity := BP.InActivity(); !inActivity {
|
|
|
+ if _, inActivity, _ := BP.InActivity(); !inActivity {
|
|
|
return fmt.Errorf("不在活动时间内")
|
|
|
}
|
|
|
status := BP.MissionsSVipBuyQuery(userId)
|
|
@@ -232,7 +234,7 @@ func (BP *JyActivity) MissionsInviteQuery(userId string) (status int) {
|
|
|
|
|
|
// MissionsInviteGiven 邀请任务奖励领取
|
|
|
func (BP *JyActivity) MissionsInviteGiven(userId string) error {
|
|
|
- if _, inActivity := BP.InActivity(); !inActivity {
|
|
|
+ if _, inActivity, _ := BP.InActivity(); !inActivity {
|
|
|
return fmt.Errorf("不在活动时间内")
|
|
|
}
|
|
|
status := BP.MissionsInviteQuery(userId)
|
|
@@ -279,7 +281,7 @@ func (BP *JyActivity) MissionsShareQuery(userId string) (status int) {
|
|
|
|
|
|
// MissionsShareGiven 分享活动
|
|
|
func (BP *JyActivity) MissionsShareGiven(userId string) error {
|
|
|
- if _, inActivity := BP.InActivity(); !inActivity {
|
|
|
+ if _, inActivity, _ := BP.InActivity(); !inActivity {
|
|
|
return fmt.Errorf("不在活动时间内")
|
|
|
}
|
|
|
status := BP.MissionsShareQuery(userId)
|