wangshan 9 роки тому
батько
коміт
88491563cd
2 змінених файлів з 7 додано та 9 видалено
  1. 6 8
      core/src/qfw/active/activemanage.go
  2. 1 1
      core/src/timetask.json

+ 6 - 8
core/src/qfw/active/activemanage.go

@@ -230,6 +230,7 @@ func (a *Activemanage) Luckdraw(activecode, id string) error {
 	if activecode == "topcj" {
 		f := FindOne("user", "{'s_m_openid':'"+openid+"'}")
 		username := (*f)["s_bindweixin"]
+		//看user里是否有黑名单字段
 		if (*f)["s_black"] != nil {
 			a.SetSession("black", "T")
 		} else {
@@ -299,6 +300,7 @@ func (a *Activemanage) Getluckdraw() error {
 	black := a.GetSession("black")
 	var i int
 	if black == "T" {
+		//黑名单指针范围
 		i = int(rand.Float64()*30 + 50)
 	} else {
 		i = getLuckDraw()
@@ -384,17 +386,13 @@ func (a *Activemanage) Getluckdraw() error {
 
 //
 func getLuckDraw() int {
-	flog := true
 	th := time.Now().Hour()
-	thflog := (th < 23 || th > 7)
+	thflog := (th < 23 && th > 7) //限时 23到第二天7点 第二套方案
 	array := []map[string]interface{}{}
-	if !CheckLimit() {
-		flog = true
-	}
-	if flog == false || thflog == false {
-		array = LuckDraw.GetAmounttwo
+	if CheckLimit() || !thflog {
+		array = LuckDraw.GetAmounttwo //第二套方案
 	} else {
-		array = LuckDraw.GetAmount
+		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-01-29 15:54:12"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-29 15:54:12"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-29 16:14:37"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-29 16:14:37"}},"marketisstart":true,"marketrate":300}