wangkaiyue 6 mesiacov pred
rodič
commit
68eee2dfd5

+ 8 - 1
src/jfw/modules/bigmember/src/entity/followEnterprise.go

@@ -407,7 +407,14 @@ func getGroup(groupStr string) (s int) {
 func checkGroup(userId, groupStr string, defaultGetAll ...bool) (map[int]bool, error) {
 	rData := db.Base.Query("SELECT id,s_name FROM follow_ent_monitor_group WHERE s_userid=?", userId)
 	if rData == nil || len(*rData) == 0 {
-		return nil, fmt.Errorf("未查询到标签")
+		//新用户插入分组
+		if _, err := db.Base.ExecBySql(fmt.Sprintf(`INSERT INTO follow_ent_monitor_group (s_name, s_userid, create_time, update_time, isPut, isdefGoup) VALUES
+        ('默认分组', '%s',  '2025-01-03 12:00:00', '2025-01-13 12:00:00', 0, 1),
+        ('竞争对手', '%s',  '2024-01-02 12:00:00', '2025-01-13 12:00:00', 1, 0),
+        ('合作伙伴', '%s',  '2024-01-01 12:00:00', '2025-01-13 12:00:00', 1, 0);`, userId, userId, userId)); err != nil {
+			log.Printf("新用户 %s创建分组异常", userId)
+		}
+		return nil, nil
 	}
 	var (
 		hasGroupId = map[int]bool{}