Browse Source

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

wangchuanjin 9 years ago
parent
commit
f43edc0919
2 changed files with 20 additions and 10 deletions
  1. 19 9
      core/src/qfw/active/activemanage.go
  2. 1 1
      core/src/timetask.json

+ 19 - 9
core/src/qfw/active/activemanage.go

@@ -121,6 +121,7 @@ func limitFun() {
 
 //解除限制的监测
 func unlimitFun() {
+
 	limitLock.Lock()
 	//非限制状态
 	if limitStatus {
@@ -305,12 +306,13 @@ func (a *Activemanage) Getluckdraw() error {
 	data["s_openid"] = openid
 	data["s_actcode"] = s_actcode
 	black := a.GetSession("black")
+	plan := redis.GetStr("other", "s_luckydraw_mode")
 	var i int
-	if black == "T" {
+	if black == "T" || plan == "" || plan == "3" {
 		//黑名单指针范围
-		i = rand.Intn(30) + 50
+		i = rand.Intn(30) + 50 //手动第三套方案
 	} else {
-		i = getLuckDraw()
+		i = getLuckDraw(plan)
 	}
 	s_prize := getPrize(i)
 	data["s_prize"] = s_prize
@@ -378,7 +380,7 @@ func (a *Activemanage) Getluckdraw() error {
 		//
 		//	msg = "  小主是真真的好运气," + s_prize + "落入您囊中!<br/>  请在微信留下您的联系方式(手机号或qq号),企明星客服会在下一个工作日9:00-17:00给小主回复哦!<br/>  小主翻个牌子,动动小手分享活动,么么哒……(分享点击页面右上方···分享到朋友圈)"
 		//} else { //在工作时间
-		msg = "  小主是真真的好运气," + s_prize + "落入您囊中。请将您的联系方式和邮寄地址留言给企明星。我们会在活动截止后尽快为您发出。<br/><br/>  分享给好友参加明天抽奖呦!乖,快去分享吧!大奖可能就在明天~~"
+		msg = "  小主是真真的好运气," + s_prize + "落入您囊中。请将您的姓名+联系方式+邮寄地址留言给企明星。我们会在活动截止后尽快为您发出。<br/><br/>  分享给好友参加明天抽奖呦!乖,快去分享吧!大奖可能就在明天~~"
 		//}
 	} else if i > 139 && i < 176 {
 		obid := a.GetSession("userId").(string)
@@ -396,14 +398,22 @@ func (a *Activemanage) Getluckdraw() error {
 }
 
 //
-func getLuckDraw() int {
+func getLuckDraw(plan string) int {
 	th := time.Now().Hour()
 	thflog := (th < 23 && th > 7) //限时 23到第二天7点 第二套方案
 	array := []map[string]interface{}{}
-	if CheckLimit() || !thflog {
-		array = LuckDraw.GetAmounttwo //第二套方案
-	} else {
-		array = LuckDraw.GetAmount //第一套方案
+	//手动
+	if plan == "1" {
+		array = LuckDraw.GetAmount //手动第一套方案
+	} else if plan == "2" {
+		array = LuckDraw.GetAmounttwo //手动第二套方案
+	} else if plan == "0" {
+		//自动
+		if CheckLimit() || !thflog {
+			array = LuckDraw.GetAmounttwo //第二套方案
+		} else {
+			array = LuckDraw.GetAmount //第一套方案
+		}
 	}
 	weightValue := getWeightRandom(array)
 	min := IntAll(array[weightValue]["min"])

+ 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-02-01 16:26:33"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-02-01 16:26:33"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-02-02 09:23:15"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-02-02 09:23:15"}},"marketisstart":true,"marketrate":300}