浏览代码

抽奖添加字段

wangshan 9 年之前
父节点
当前提交
2193f82101
共有 2 个文件被更改,包括 16 次插入15 次删除
  1. 15 14
      core/src/qfw/active/activemanage.go
  2. 1 1
      core/src/timetask.json

+ 15 - 14
core/src/qfw/active/activemanage.go

@@ -117,6 +117,7 @@ func (a *Activemanage) Getluckdraw() error {
 
 	s_prize := getPrize(i)
 	data["s_prize"] = s_prize
+	data["i_degree"] = i
 	data["l_timestamp"] = time.Now().Unix()
 	nowdate := time.Now().Unix()
 	enddate := LuckDraw.EndDate
@@ -127,12 +128,12 @@ func (a *Activemanage) Getluckdraw() error {
 		flog = "T"
 	}
 	//红包
-	if (i > 185 && i < 220) || (i > 320 && i < 355) {
+	if (i > 184 && i < 221) || (i > 319 && i < 356) {
 		var amount int //红包金额以“元”为单位,微信红包以“分”为单位
-		if i > 185 && i < 220 {
+		if i > 184 && i < 221 {
 			amount = 500 //红包金额以“元”为单位,微信红包以“分”为单位
 
-		} else if i > 320 && i < 355 {
+		} else if i > 319 && i < 356 {
 			amount = 100 //红包金额以“元”为单位,微信红包以“分”为单位
 		}
 		bm := qrpc.BonusMsg{Mchbillno: fmt.Sprint(today.Unix()),
@@ -168,7 +169,7 @@ func (a *Activemanage) Getluckdraw() error {
 
 		}
 		msg = "  小主是真真的好运气," + s_prize + "落入您囊中。红包将由系统自动发放到您的微信,请注意查收。<br/><br/>  分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
-	} else if (i > 275 && i < 310) || (i > 95 && i < 130) {
+	} else if (i > 274 && i < 311) || (i > 94 && i < 131) {
 		//时间判断,提醒不同
 		//now := time.Now()
 		//不在工作时间
@@ -178,7 +179,7 @@ func (a *Activemanage) Getluckdraw() error {
 		//} else { //在工作时间
 		msg = "  小主是真真的好运气," + s_prize + "落入您囊中。请将您的联系方式和邮寄地址留言给企明星。我们会在活动截止后尽快为您发出。<br/><br/>  分享至朋友圈或好友即可以获得明天抽奖资格呦!乖,快去分享吧!大奖可能就在明天~~"
 		//}
-	} else if i > 140 && i < 175 {
+	} else if i > 139 && i < 176 {
 		obid := BsonIdToSId(a.GetSession("userId"))
 		b := credit.UpuserCreditSession(obid, "b6", "B", nil, a.Action)
 		if b == true {
@@ -208,22 +209,22 @@ func getLuckDraw() int {
 		amount := min + rand.New(rand.NewSource(time.Now().UnixNano())).Intn(max-min)
 		if amount <= 0 {
 			return 1
-		} else if amount > 275 && amount < 310 {
+		} else if amount > 274 && amount < 311 {
 			count := Count("winningrecord", "{'s_prize':'《牛奶可乐经济学》'}")
 			if count > 6 {
 				amount = 245
 			}
-		} else if amount > 95 && amount < 130 {
+		} else if amount > 94 && amount < 131 {
 			count := Count("winningrecord", "{'s_prize':'限量版U盘'}")
 			if count > 100 {
 				amount = 255
 			}
-		} else if amount > 185 && amount < 220 {
+		} else if amount > 184 && amount < 221 {
 			count := Count("winningrecord", "{'s_prize':'五元现金红包'}")
 			if count > 200 {
 				amount = 65
 			}
-		} else if amount > 320 && amount < 355 {
+		} else if amount > 319 && amount < 356 {
 			count := Count("winningrecord", "{'s_prize':'一元现金红包'}")
 			if count > 2500 {
 				amount = 75
@@ -256,19 +257,19 @@ func getPrize(i int) string {
 	if i > 0 {
 		if 0 <= i && i < 45 {
 			prize = "iPad mini"
-		} else if 91 <= i && i < 136 {
+		} else if 95 <= i && i < 121 {
 			prize = "限量版U盘"
 
-		} else if 140 <= i && i < 175 {
+		} else if 140 <= i && i < 176 {
 			prize = "200积分"
 
-		} else if 181 <= i && i < 226 {
+		} else if 190 <= i && i < 221 {
 			prize = "五元现金红包"
 
-		} else if 271 <= i && i < 316 {
+		} else if 280 <= i && i < 311 {
 			prize = "《牛奶可乐经济学》"
 
-		} else if 320 <= i && i < 355 {
+		} else if 325 <= i && i < 351 {
 			prize = "一元现金红包"
 
 		} else {

+ 1 - 1
core/src/timetask.json

@@ -1 +1 @@
-{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-28 12:54:36"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-28 12:54:36"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-29 08:28:58"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-29 08:28:58"}},"marketisstart":true,"marketrate":300}