正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
@@ -84,7 +84,9 @@ func DeleteChanceFavorite(id int64) (err error) { | @@ -84,7 +84,9 @@ func DeleteChanceFavorite(id int64) (err error) { | ||
84 | //获取用户点赞收藏机会 | 84 | //获取用户点赞收藏机会 |
85 | func GetChanceFavorites(userId, companyId int64, markFlag, sourceType int, sourceId int64, lastId int64, pageSize int) (v []*ChanceFavorite, total int, err error) { | 85 | func GetChanceFavorites(userId, companyId int64, markFlag, sourceType int, sourceId int64, lastId int64, pageSize int) (v []*ChanceFavorite, total int, err error) { |
86 | sql := mybeego.NewSqlExutor().Table("chance_favorite").Order("create_at desc") | 86 | sql := mybeego.NewSqlExutor().Table("chance_favorite").Order("create_at desc") |
87 | - sql.Where(fmt.Sprintf("user_id=%d", userId)) | 87 | + if userId > 0 { |
88 | + sql.Where(fmt.Sprintf("user_id=%d", userId)) | ||
89 | + } | ||
88 | sql.Where(fmt.Sprintf("company_id=%d", companyId)) | 90 | sql.Where(fmt.Sprintf("company_id=%d", companyId)) |
89 | if sourceType > 0 { | 91 | if sourceType > 0 { |
90 | sql.Where(fmt.Sprintf("source_type=%d", sourceType)) | 92 | sql.Where(fmt.Sprintf("source_type=%d", sourceType)) |
-
请 注册 或 登录 后发表评论