xingzai 1 سال پیش
والد
کامیت
41cbb7b141
2فایلهای تغییر یافته به همراه11 افزوده شده و 11 حذف شده
  1. 1 1
      services/init_10.3.go
  2. 10 10
      services/init_10.5.1.go

+ 1 - 1
services/init_10.3.go

@@ -7,7 +7,7 @@ import (
 
 //10.3版本上线需要更新的数据
 
-func init1111() {
+func init51111() {
 	var condition string
 	var pars []interface{}
 	var err error

+ 10 - 10
services/init_10.5.1.go

@@ -9,7 +9,7 @@ import (
 
 //10.5.1版本上线需要更新的数据
 
-func init5111() {
+func init1111() {
 	var condition string
 	var pars []interface{}
 	var err error
@@ -48,7 +48,7 @@ func init5111() {
 		item.CreateTime = time.Now()
 		item.ModifyTime = time.Now()
 		items = append(items, item)
-		if len(items)%5 == 0 {
+		if len(items)%5000 == 0 {
 			err = models.CygxUserLabelMulti(items)
 			fmt.Println(err)
 			items = make([]*models.CygxUserLabel, 0)
@@ -60,7 +60,7 @@ func init5111() {
 	}
 }
 
-func init52222() {
+func init5222() {
 	var condition string
 	var pars []interface{}
 	var err error
@@ -99,7 +99,7 @@ func init52222() {
 		item.CreateTime = time.Now()
 		item.ModifyTime = time.Now()
 		items = append(items, item)
-		if len(items)%5 == 0 {
+		if len(items)%5000 == 0 {
 			err = models.CygxUserLabelMulti(items)
 			fmt.Println(err)
 			items = make([]*models.CygxUserLabel, 0)
@@ -176,7 +176,7 @@ func init5333() {
 				item.CreateTime = utils.StrTimeToTime(v.ActivityTime)
 				item.ModifyTime = time.Now()
 				items = append(items, item)
-				if len(items)%50 == 0 {
+				if len(items)%5000 == 0 {
 					_, err = models.AddCygxUserLabelActivityList(items)
 					fmt.Println(err)
 					items = make([]*models.CygxUserLabelActivity, 0)
@@ -246,7 +246,7 @@ func init5444() {
 			item.CreateTime = utils.StrTimeToTime(user.CreateTime)
 			item.ModifyTime = time.Now()
 			items = append(items, item)
-			if len(items)%50 == 0 {
+			if len(items)%5000 == 0 {
 				_, err = models.AddCygxUserLabelActivitySpecialList(items)
 				fmt.Println(err)
 				items = make([]*models.CygxUserLabelActivitySpecial, 0)
@@ -260,7 +260,7 @@ func init5444() {
 	}
 }
 
-func init5555() {
+func init555() {
 	var condition string
 	var pars []interface{}
 	var err error
@@ -278,7 +278,7 @@ func init5555() {
 		mapIndustryName[v.IndustrialManagementId] = v.IndustryName
 	}
 	//fmt.Println(mapIndustryName)
-	condition = ` AND   stop_time > 4  AND create_time > '2022-11-25 00:00:00' GROUP BY article_id  `
+	condition = ` AND   stop_time > 3  AND create_time > '2022-11-25 00:00:00' GROUP BY article_id  `
 	//condition = `   AND   stop_time > 4   AND create_time > '2023-04-25 00:00:00' GROUP BY article_id  `
 	listArtGroup, err := models.GetCygxArticleHistoryRecordNewpvList(condition, pars)
 	if err != nil {
@@ -387,7 +387,7 @@ func init5555() {
 			itemsMap[articleId] = items
 		}
 	}
-	condition = `   AND   stop_time > 4   AND create_time > '2022-11-25 00:00:00'   `
+	condition = `   AND   stop_time > 3   AND create_time > '2022-11-25 00:00:00'   `
 	//condition = `  AND   stop_time > 4    AND create_time > '2023-4-25 00:00:00'   `
 	listArt, err := models.GetCygxArticleHistoryRecordNewpvList(condition, pars)
 	if err != nil {
@@ -420,7 +420,7 @@ func init5555() {
 					item.CreateTime = user.CreateTime
 					item.ModifyTime = time.Now()
 					items = append(items, item)
-					if len(items)%500 == 0 {
+					if len(items)%5000 == 0 {
 						_, err = models.AddCygxUserLabelArticleList(items)
 						fmt.Println(err)
 						items = make([]*models.CygxUserLabelArticle, 0)