Przeglądaj źródła

Merge branch 'dev_v1.1.3_wh' of moapp/jyPoints into feature/v1.1.3

王浩 1 rok temu
rodzic
commit
ea7c97e9b5
2 zmienionych plików z 11 dodań i 21 usunięć
  1. 11 8
      resourceBrushLibrary/entity/order.go
  2. 0 13
      resourceBrushLibrary/main.go

+ 11 - 8
resourceBrushLibrary/entity/order.go

@@ -48,12 +48,12 @@ func OrderResourceRun(now time.Time, end int64) {
 			},
 		},
 	}).Select(map[string]interface{}{
-		"_id":           1,
-		"l_vip_endtime": 1,
+		"_id":              1,
+		"l_vip_endtime":    1,
+		"subpush_inactive": 1,
 	}).Iter()
 	endTime := time.Date(now.Year(), now.Month(), 1, 0, 0, 0, 0, now.Location()).AddDate(0, 1, -1).Format(Date_Short_Layout)
 	for m := make(map[string]interface{}); it.Next(&m); {
-		log.Println(1111, m)
 		pool <- true
 		wait.Add(1)
 		go func(user map[string]interface{}) {
@@ -77,10 +77,15 @@ func OrderResourceRun(now time.Time, end int64) {
 				VipTime:      FormatDateByInt64(&l_vip_endtime, Date_Short_Layout),
 				Model:        3,
 			})
+			subpush_inactive := gconv.Int64(m["subpush_inactive"])
+			if subpush_inactive == 1 {
+				subpush_inactive = -1
+			}
 			//数据打标记
 			cc := Mgo_qfw.UpdateById("user", userId, map[string]interface{}{
 				"$set": map[string]interface{}{
-					"i_grantDate": grantDate,
+					"i_grantDate":      grantDate,
+					"subpush_inactive": subpush_inactive,
 				}})
 			log.Println("user表更新成功", cc, userId, user)
 
@@ -110,9 +115,7 @@ func OrderResourceRun(now time.Time, end int64) {
 		"l_vip_endtime": 1,
 		"i_userid":      1,
 	}).Iter()
-	log.Println("ent_user", itEnt)
 	for m := make(map[string]interface{}); itEnt.Next(&m); {
-		log.Println(2222, m)
 		pool <- true
 		wait.Add(1)
 		go func(user map[string]interface{}) {
@@ -141,10 +144,10 @@ func OrderResourceRun(now time.Time, end int64) {
 				VipTime:      FormatDateByInt64(&l_vip_endtime, Date_Short_Layout),
 				Model:        3,
 			})
-			log.Println(Mgo_qfw.UpdateById("ent_user", id, map[string]interface{}{
+			Mgo_qfw.UpdateById("ent_user", id, map[string]interface{}{
 				"$set": map[string]interface{}{
 					"i_grantDate": grantDate,
-				}}), 333)
+				}})
 		}(m)
 		m = make(map[string]interface{})
 	}

+ 0 - 13
resourceBrushLibrary/main.go

@@ -2,7 +2,6 @@ package main
 
 import (
 	"github.com/robfig/cron"
-	"log"
 	"resourceBrushLibrary/config"
 	"resourceBrushLibrary/entity"
 	"time"
@@ -19,7 +18,6 @@ func main() {
 
 // 每月执行
 func MonthlyTask() {
-	log.Println(time.Now())
 	c := cron.New()
 	// 添加要执行的任务
 	c.AddFunc(config.Config.MonthlyTask, func() {
@@ -37,17 +35,6 @@ func MonthlyTask() {
 
 // 每分钟执行
 func MinTask() {
-	//entity.OrderResource()
-	log.Println(time.Now())
-	/*	c := cron.New()
-		// 添加要执行的任务
-		c.AddFunc(config.Config.MinTask, func() {
-			// 执行任务的代码
-			entity.OrderResource()
-		})
-		// 启动Cron调度器
-		c.Start()
-		select {}*/
 	for {
 		entity.OrderResource()
 		time.Sleep(time.Duration(config.Config.MinTask) * 60 * time.Second)