You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iferr:=db.Debug().Raw(` `+res+` SELECT cat_tree.* FROM cat_tree where is_deleted = 0 and id not in (8) and parent_id =8 order by id desc`).Limit(limit).Offset(offset).Find(&categories).Error;err!=nil{
47
+
iferr:=db.Debug().Raw(` `+res+` SELECT cat_tree.* FROM cat_tree where is_deleted = 0 and id not in (1) and parent_id =1 order by id desc limit `+strconv.Itoa(limit)+` offset `+strconv.Itoa(offset)).Find(&categories).Error;err!=nil{
51
48
52
-
return model.CategoriesList{},err
49
+
return model.CategoriesList{},err
53
50
}
54
-
55
-
iferr:=db.Debug().Raw(` `+res+` SELECT count(*) FROM cat_tree where is_deleted = 0 and id not in (8) and parent_id =8 group by id order by id desc`).Count(&count).Error;err!=nil{
56
51
57
-
return model.CategoriesList{},err
58
-
}
52
+
iferr:=db.Debug().Raw(` `+res+` SELECT count(*) FROM cat_tree where is_deleted = 0 and id not in (1) and parent_id =1 group by id order by id desc`).Count(&count).Error; err!=nil {
err:=db.Debug().Raw(` `+res+` SELECT cat_tree.* FROM cat_tree where is_deleted = 0 and id not in (`+strconv.Itoa(parentCat.ID)+`) and parent_id =`+strconv.Itoa(parentCat.ID)+` order by id desc`).Limit(limit).Offset(offset).Find(&childCategories).Error
67
+
err:=db.Debug().Raw(` `+res+` SELECT cat_tree.* FROM cat_tree where is_deleted = 0 and id not in (`+strconv.Itoa(parentCat.ID)+`) and parent_id =`+strconv.Itoa(parentCat.ID)+` order by id desc`).Find(&childCategories).Error
0 commit comments