|
@@ -743,28 +743,46 @@ func userbase() {
|
|
|
log.Println("userbase uid 注册时间 ", registedates)
|
|
|
if time.Now().Unix()-registedates.Unix() > int64(db.RegTimes)*86400 {
|
|
|
if count == 0 {
|
|
|
- // TiDb.Insert("dwd_f_crm_open_sea", map[string]interface{}{
|
|
|
- // "clue_id": clueId,
|
|
|
- // "comeintime": nowTime,
|
|
|
- // "comeinsource": 2,
|
|
|
- // })
|
|
|
- clueId := TiDb.Insert("dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
- "userid": userId,
|
|
|
- "uid": uId,
|
|
|
- "is_assign": 0,
|
|
|
- "comeintime": nowTime,
|
|
|
- "createtime": nowTime,
|
|
|
- "updatetime": nowTime,
|
|
|
- "cluename": phone,
|
|
|
- "top_cluetype": "532",
|
|
|
- "sub_cluetype": "475",
|
|
|
- "trailstatus": "01",
|
|
|
- "name": name,
|
|
|
- "phone": phone,
|
|
|
- "comeintime_open": nowTime,
|
|
|
- "comeinsource_open": 1,
|
|
|
- "FREEZE_TIME": nowTime,
|
|
|
- })
|
|
|
+ clueId := int64(0)
|
|
|
+ sql := fmt.Sprintf(`select * from freeClubSign where mogUserId="%s" and sub_again_date > "%s" `, selectTimeEnd, userId)
|
|
|
+ data := BiService.SelectBySql(sql, "")
|
|
|
+ if len(*data) > 0 && userId != "" {
|
|
|
+ clueId = TiDb.Insert("dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
+ "userid": userId,
|
|
|
+ "uid": uId,
|
|
|
+ "is_assign": 0,
|
|
|
+ "comeintime": nowTime,
|
|
|
+ "createtime": nowTime,
|
|
|
+ "updatetime": nowTime,
|
|
|
+ "cluename": phone,
|
|
|
+ "top_cluetype": "532",
|
|
|
+ "sub_cluetype": "670",
|
|
|
+ "trailstatus": "01",
|
|
|
+ "name": name,
|
|
|
+ "phone": phone,
|
|
|
+ "comeintime_open": nowTime,
|
|
|
+ "comeinsource_open": 1,
|
|
|
+ "FREEZE_TIME": nowTime,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ clueId = TiDb.Insert("dwd_f_crm_clue_info", map[string]interface{}{
|
|
|
+ "userid": userId,
|
|
|
+ "uid": uId,
|
|
|
+ "is_assign": 0,
|
|
|
+ "comeintime": nowTime,
|
|
|
+ "createtime": nowTime,
|
|
|
+ "updatetime": nowTime,
|
|
|
+ "cluename": phone,
|
|
|
+ "top_cluetype": "532",
|
|
|
+ "sub_cluetype": "475",
|
|
|
+ "trailstatus": "01",
|
|
|
+ "name": name,
|
|
|
+ "phone": phone,
|
|
|
+ "comeintime_open": nowTime,
|
|
|
+ "comeinsource_open": 1,
|
|
|
+ "FREEZE_TIME": nowTime,
|
|
|
+ })
|
|
|
+ }
|
|
|
if clueId > 0 {
|
|
|
TiDb.Insert("dwd_f_userbase_contacts", map[string]interface{}{
|
|
|
"status": 1,
|