Просмотр исходного кода

Merge branch 'master' into feature/v1.5.13

yuelujie 8 месяцев назад
Родитель
Сommit
26c12e4f2d
2 измененных файлов с 12 добавлено и 3 удалено
  1. 11 2
      clueSync/tag.go
  2. 1 1
      telemarketingEtl/entity/dwd_f_userbase_visit_info.go

+ 11 - 2
clueSync/tag.go

@@ -2,6 +2,7 @@ package main
 
 import (
 	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
 	"log"
 	"regexp"
 	"strings"
@@ -110,12 +111,16 @@ func FormatTag(data map[string]interface{}, count int) {
 		search_areass = strings.Join(search_areas_arr, ",")
 		search_wordss = strings.Join(search_words_arr, ",")
 	}
-
 	//订单购买的服务
 	orderData := TiDb.Find("dwd_f_userbase_order_info", map[string]interface{}{"userid": userId, "order_status": 1, "delete_status": 0}, "", "", -1, -1)
+	//orderData := TiDb.SelectBySql("select  *  from  dwd_f_userbase_order_info where   userid=? and  order_status=1 and  delete_status=0 and  payable_money > 0", userId)
 	if orderData != nil && len(*orderData) > 0 {
 		product_type_arr, product_type_arrs := []string{}, []string{}
 		for _, v := range *orderData {
+			payable_money := gconv.Int64(v["payable_money"])
+			if payable_money <= 0 {
+				continue
+			}
 			product_type := common.ObjToString(v["product_type"])
 			if product_type != "" {
 				product_type_arr = append(product_type_arr, product_type)
@@ -242,7 +247,7 @@ func tagAddSync() {
 		}
 	}
 	log.Println("注册日期定时任务结束")
-	orderData := TiDb.SelectBySql(`select product_type,autoUpdate,uid from dwd_f_userbase_order_info where order_status = 1 and autoUpdate >= "` + cfg.LastOrderTime + `" order by autoUpdate desc`)
+	orderData := TiDb.SelectBySql(`select product_type,autoUpdate,uid from dwd_f_userbase_order_info where order_status = 1  and autoUpdate >= "` + cfg.LastOrderTime + `" order by autoUpdate desc`)
 	if orderData != nil && len(*orderData) > 0 {
 		for k, order := range *orderData {
 			nowTime := time.Now().Format("2006-01-02 15:04:05")
@@ -260,6 +265,10 @@ func tagAddSync() {
 			if orderDatas != nil && len(*orderDatas) > 0 {
 				product_type_arr, product_type_arrs := []string{}, []string{}
 				for _, v := range *orderDatas {
+					payable_money := gconv.Int64(v["payable_money"])
+					if payable_money <= 0 {
+						continue
+					}
 					product_type := common.ObjToString(v["product_type"])
 					log.Println("product_type ", product_type)
 					if product_type != "" {

+ 1 - 1
telemarketingEtl/entity/dwd_f_userbase_visit_info.go

@@ -104,7 +104,7 @@ func VisitInfoAdd(start, end int64) {
 			thisData = map[string]interface{}{}
 			count++
 			if count%50000 == 0 {
-				log.Printf("遍历日志表", table, count)
+				log.Printf("遍历日志表, %s, %d", table, count)
 			}
 		}
 		log.Println("遍历日志表结束。。。", table, count)