瀏覽代碼

修改credit

renzheng 9 年之前
父節點
當前提交
b6b828964e
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 1 1
      core/src/timetask.json
  2. 4 4
      credit/src/main.go

+ 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-22 13:30:43"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-22 13:30:43"}},"marketisstart":true,"marketrate":300}
+{"comment":{"c_rate":720,"commentrate":900},"market":{"demand":{"attr":["i_hits","i_bids","i_status"],"timepoint":"2016-01-22 13:40:43"},"service":{"attr":["i_hits","i_sales","i_comments","i_score","i_appcounts"],"timepoint":"2016-01-22 13:40:43"}},"marketisstart":true,"marketrate":300}

+ 4 - 4
credit/src/main.go

@@ -81,7 +81,7 @@ func init() {
 		minutes, _ = strconv.Atoi(timerHMS[2])
 
 		http.HandleFunc("/m", saveHandlerFunc)
-		http.ListenAndServe(":8878", nil)
+		go http.ListenAndServe(":8878", nil)
 
 	}
 
@@ -202,8 +202,8 @@ func TimerSwordFishFromUser() {
 					} {
 						query := coll.Find(&map[string]interface{}{
 							"o_msgset." + typeName + ".l_enddate": map[string]interface{}{
-								"$gte": next64 - 600,
-								"$lte": next64 + int64(swordfish_tipBeforeDays[0]*24*3600) + 7200,
+								"$gte": next64 - 60000,
+								"$lte": next64 + int64(swordfish_tipBeforeDays[0]*24*3600) + 60000,
 							},
 							"o_msgset." + typeName + ".i_status":       1,
 							"o_msgset." + typeName + ".i_switchstatus": 1,
@@ -215,7 +215,7 @@ func TimerSwordFishFromUser() {
 								tmpCode := tmp["o_msgset"].(map[string]interface{})[typeName].(map[string]interface{})
 								endDate := tmpCode["l_enddate"].(int64)
 								sub64 := (endDate - next64) / 86400
-								if sub64 == 0 {
+								if sub64 <= 0 {
 									//自动扣费
 									doSubCreditByUser(util.BsonIdToSId(tmp["_id"]), tmp["s_m_openid"].(string), typeName, code, &next, tmp)
 								} else {