123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- package services
- import (
- "fmt"
- "hongze/hongze_cygx/models"
- "hongze/hongze_cygx/utils"
- )
- func init11() {
- var condition string
- var pars []interface{}
- list, tmpErr := models.GetYanxuanSpecialAuthorList(condition, pars, 0, 9999)
- if tmpErr != nil {
- fmt.Println(tmpErr)
- return
- }
- for _, v := range list {
- fmt.Println(v.UserId)
- 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)
- }
- }
|