|
@@ -74,7 +74,7 @@ func VisitInfoAdd(start, end int64) {
|
|
userid, uid = GetUserIdByPositionId(userid)
|
|
userid, uid = GetUserIdByPositionId(userid)
|
|
} else {
|
|
} else {
|
|
idmdata := config.JianyuSubjectdb.SelectBySql(`select uid from dwd_f_userbase_id_mapping where userid = "` + userid + `"`)
|
|
idmdata := config.JianyuSubjectdb.SelectBySql(`select uid from dwd_f_userbase_id_mapping where userid = "` + userid + `"`)
|
|
- if idmdata != nil {
|
|
|
|
|
|
+ if idmdata != nil && len(*idmdata) > 0 {
|
|
uid = gconv.String((*idmdata)[0]["uid"])
|
|
uid = gconv.String((*idmdata)[0]["uid"])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -125,7 +125,7 @@ func VisitInfoAdd(start, end int64) {
|
|
} else {
|
|
} else {
|
|
config.JianyuSubjectdb.InsertBySql(`INSERT INTO dwd_f_userbase_visit_info
|
|
config.JianyuSubjectdb.InsertBySql(`INSERT INTO dwd_f_userbase_visit_info
|
|
(userid,DATE, number, platform,createtime,contentnum,portraitnum,searchnum)
|
|
(userid,DATE, number, platform,createtime,contentnum,portraitnum,searchnum)
|
|
- VALUES (?,?,?,?,?,?)`, userid, craetetimeStr, 1, platform, craetetimeStr, contentnum, portraitnum, searchnum)
|
|
|
|
|
|
+ VALUES (?,?,?,?,?,?,?,?)`, userid, craetetimeStr, 1, platform, craetetimeStr, contentnum, portraitnum, searchnum)
|
|
}
|
|
}
|
|
if uid != "" {
|
|
if uid != "" {
|
|
if config.JianyuSubjectdb.CountBySql(`select count(1) from dwd_f_crm_attribute_label where uid = ?`, uid) > 0 {
|
|
if config.JianyuSubjectdb.CountBySql(`select count(1) from dwd_f_crm_attribute_label where uid = ?`, uid) > 0 {
|
|
@@ -145,6 +145,7 @@ func VisitInfoAdd(start, end int64) {
|
|
}
|
|
}
|
|
thisData = map[string]interface{}{}
|
|
thisData = map[string]interface{}{}
|
|
}
|
|
}
|
|
|
|
+ log.Printf("%s一共完成%d条数据\n", table, count)
|
|
log.Println("end!")
|
|
log.Println("end!")
|
|
// sWait.Wait()
|
|
// sWait.Wait()
|
|
}(table)
|
|
}(table)
|
|
@@ -202,7 +203,7 @@ func CountMaxVisit() {
|
|
}
|
|
}
|
|
count++
|
|
count++
|
|
if count%2000 == 0 {
|
|
if count%2000 == 0 {
|
|
- log.Println("current-------", count)
|
|
|
|
|
|
+ log.Println("CountMaxVisit current-------", count)
|
|
}
|
|
}
|
|
userid := common.ObjToString(ret["userid"])
|
|
userid := common.ObjToString(ret["userid"])
|
|
mDate := common.ObjToString(ret["date"])
|
|
mDate := common.ObjToString(ret["date"])
|
|
@@ -243,6 +244,8 @@ func CountMaxVisit() {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 先 归0
|
|
|
|
+ config.JianyuSubjectdb.ExecBySql("UPDATE dwd_f_crm_attribute_label SET continuous_visit_day = 0 WHERE continuous_visit_day != 0")
|
|
for _, v := range mData {
|
|
for _, v := range mData {
|
|
if b := config.JianyuSubjectdb.Update("dwd_f_crm_attribute_label", bson.M{"uid": v.uId}, bson.M{"continuous_visit_day": v.days}); !b {
|
|
if b := config.JianyuSubjectdb.Update("dwd_f_crm_attribute_label", bson.M{"uid": v.uId}, bson.M{"continuous_visit_day": v.days}); !b {
|
|
config.JianyuSubjectdb.Insert("dwd_f_crm_attribute_label", map[string]interface{}{
|
|
config.JianyuSubjectdb.Insert("dwd_f_crm_attribute_label", map[string]interface{}{
|
|
@@ -259,6 +262,7 @@ func CountMaxVisit() {
|
|
// @Description 日期相差天数
|
|
// @Description 日期相差天数
|
|
// @Date 2024/8/22
|
|
// @Date 2024/8/22
|
|
func VerifyDate(d1, d2 string) int {
|
|
func VerifyDate(d1, d2 string) int {
|
|
|
|
+ log.Println("d1: ", d1, "d2: ", d2)
|
|
if d1 == d2 {
|
|
if d1 == d2 {
|
|
return 0
|
|
return 0
|
|
}
|
|
}
|
|
@@ -413,7 +417,7 @@ func Count3DaysDetail() {
|
|
func VipExpire() {
|
|
func VipExpire() {
|
|
now := time.Now()
|
|
now := time.Now()
|
|
config.JianyuSubjectdb.ExecBySql("update dwd_f_crm_attribute_label set supersub = 0 where supersub = 1")
|
|
config.JianyuSubjectdb.ExecBySql("update dwd_f_crm_attribute_label set supersub = 0 where supersub = 1")
|
|
- config.JianyuSubjectdb.ExecBySql("UPDATE dwd_f_data_equity_info SET supersub = 1 WHERE product_type = '超级订阅' AND endtime > ?", now.Format(date.Date_Short_Layout))
|
|
|
|
|
|
+ config.JianyuSubjectdb.ExecBySql("UPDATE dwd_f_crm_attribute_label SET supersub = 1 WHERE product_type = '超级订阅' AND endtime > ?", now.Format(date.Date_Short_Layout))
|
|
config.JianyuSubjectdb.ExecBySql("update dwd_f_crm_attribute_label set areasubpkg = 0 where areasubpkg = 1")
|
|
config.JianyuSubjectdb.ExecBySql("update dwd_f_crm_attribute_label set areasubpkg = 0 where areasubpkg = 1")
|
|
- config.JianyuSubjectdb.ExecBySql("UPDATE dwd_f_data_equity_info SET areasubpkg = 1 WHERE product_type = '省份订阅包' AND endtime > ?", now.Format(date.Date_Short_Layout))
|
|
|
|
|
|
+ config.JianyuSubjectdb.ExecBySql("UPDATE dwd_f_crm_attribute_label SET areasubpkg = 1 WHERE product_type = '省份订阅包' AND endtime > ?", now.Format(date.Date_Short_Layout))
|
|
}
|
|
}
|