|
@@ -3,6 +3,7 @@ package services
|
|
|
import (
|
|
|
"fmt"
|
|
|
"hongze/hongze_cygx/models"
|
|
|
+ "hongze/hongze_cygx/utils"
|
|
|
)
|
|
|
|
|
|
func init11() {
|
|
@@ -18,3 +19,91 @@ func init11() {
|
|
|
UdpateYanxuanSpecialauthorArticleNum(v.UserId)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func init77() {
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+
|
|
|
+ //condition = " AND is_del = 0 AND company_id > 1 AND article_id IN (SELECT article_id FROM cygx_article) "
|
|
|
+ //total, err := models.GetCygxArticleHistoryRecordAllCountBycondition(condition, pars)
|
|
|
+ //
|
|
|
+ //if err != nil {
|
|
|
+ // fmt.Println(err)
|
|
|
+ // return
|
|
|
+ //}
|
|
|
+ //for i := 0; i <= total/2000; i++ {
|
|
|
+ // allList, err := models.GetCygxArticleHistoryRecordAllList(condition, pars, 2000*i, 2000)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println("GetCygxArticleHistoryRecordByCompanyListNew Err:", err.Error())
|
|
|
+ //
|
|
|
+ // }
|
|
|
+ // var items []*models.CygxArticleAndYanxuanRecord
|
|
|
+ // fmt.Println(len(allList))
|
|
|
+ // for _, v := range allList {
|
|
|
+ // item := new(models.CygxArticleAndYanxuanRecord)
|
|
|
+ // item.SourceId = v.ArticleId
|
|
|
+ // item.Source = utils.CYGX_OBJ_ARTICLE
|
|
|
+ // item.UserId = v.UserId
|
|
|
+ // item.RealName = v.RealName
|
|
|
+ // item.Mobile = v.Mobile
|
|
|
+ // item.Email = v.Email
|
|
|
+ // item.CompanyId = v.CompanyId
|
|
|
+ // item.CompanyName = v.CompanyName
|
|
|
+ // item.CompanyId = v.CompanyId
|
|
|
+ // item.CreateTime = v.CreateTime
|
|
|
+ // item.ModifyTime = v.ModifyTime
|
|
|
+ // item.StopTime = v.StopTime
|
|
|
+ //
|
|
|
+ // if v.Source == "CELUE" {
|
|
|
+ // item.RegisterPlatform = 3
|
|
|
+ // } else if v.Source == "WEB" {
|
|
|
+ // item.RegisterPlatform = 2
|
|
|
+ // } else {
|
|
|
+ // item.RegisterPlatform = 1
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // items = append(items, item)
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // err = models.AddCygxArticleAndYanxuanRecordMulti(items)
|
|
|
+ // if err != nil {
|
|
|
+ // fmt.Println(err)
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ //}
|
|
|
+ condition = " AND yanxuan_special_id IN (SELECT id FROM cygx_yanxuan_special ) "
|
|
|
+ list, err := models.GetCygxYanxuanSpecialRecordRespList(condition, pars, 0, 99999)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("GetCygxArticleHistoryRecordByCompanyListNew Err:", err.Error())
|
|
|
+
|
|
|
+ }
|
|
|
+ var items []*models.CygxArticleAndYanxuanRecord
|
|
|
+ fmt.Println(len(list))
|
|
|
+ for _, v := range list {
|
|
|
+ item := new(models.CygxArticleAndYanxuanRecord)
|
|
|
+ item.SourceId = v.YanxuanSpecialId
|
|
|
+ item.Source = utils.CYGX_OBJ_YANXUANSPECIAL
|
|
|
+ item.UserId = v.UserId
|
|
|
+ item.RealName = v.RealName
|
|
|
+ item.Mobile = v.Mobile
|
|
|
+ item.Email = v.Email
|
|
|
+ item.CompanyId = v.CompanyId
|
|
|
+ item.CompanyName = v.CompanyName
|
|
|
+ item.CompanyId = v.CompanyId
|
|
|
+ item.CreateTime = v.CreateTime
|
|
|
+ item.ModifyTime = v.ModifyTime
|
|
|
+ item.StopTime = v.StopTime
|
|
|
+
|
|
|
+ item.RegisterPlatform = v.RegisterPlatform
|
|
|
+
|
|
|
+ items = append(items, item)
|
|
|
+ }
|
|
|
+ fmt.Println(len(items))
|
|
|
+
|
|
|
+ //return
|
|
|
+ err = models.AddCygxArticleAndYanxuanRecordMulti(items)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ }
|
|
|
+
|
|
|
+}
|