|
@@ -35,7 +35,7 @@ type ArticleInterviewApplyResp struct {
|
|
|
|
|
|
func RemoveArticleInterviewApply(userId, articleId int) (err error) {
|
|
func RemoveArticleInterviewApply(userId, articleId int) (err error) {
|
|
o := orm.NewOrm()
|
|
o := orm.NewOrm()
|
|
- sql := `DELETE FROM cygx_interview_apply WHERE user_id=? AND article_id=? `
|
|
|
|
|
|
+ sql := `DELETE FROM cygx_interview_apply WHERE user_id=? AND article_id=? AND status<>'已取消' `
|
|
_, err = o.Raw(sql, userId, articleId).Exec()
|
|
_, err = o.Raw(sql, userId, articleId).Exec()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -47,13 +47,13 @@ func GetArticleInterviewApplyUsersCount(articleId int) (count int, err error) {
|
|
}
|
|
}
|
|
|
|
|
|
func GetArticleInterviewApply(userId, articleId int) (item *CygxInterviewApply, err error) {
|
|
func GetArticleInterviewApply(userId, articleId int) (item *CygxInterviewApply, err error) {
|
|
- sql := `SELECT * FROM cygx_interview_apply WHERE user_id=? AND article_id=? `
|
|
|
|
|
|
+ sql := `SELECT * FROM cygx_interview_apply WHERE user_id=? AND article_id=? AND status<>'已取消' `
|
|
err = orm.NewOrm().Raw(sql, userId, articleId).QueryRow(&item)
|
|
err = orm.NewOrm().Raw(sql, userId, articleId).QueryRow(&item)
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
func GetArticleInterviewApplyCount(userId, articleId int) (count int, err error) {
|
|
func GetArticleInterviewApplyCount(userId, articleId int) (count int, err error) {
|
|
- sql := `SELECT COUNT(1) AS count FROM cygx_interview_apply WHERE user_id=? AND article_id=? `
|
|
|
|
|
|
+ sql := `SELECT COUNT(1) AS count FROM cygx_interview_apply WHERE user_id=? AND article_id=? AND status<>'已取消' `
|
|
err = orm.NewOrm().Raw(sql, userId, articleId).QueryRow(&count)
|
|
err = orm.NewOrm().Raw(sql, userId, articleId).QueryRow(&count)
|
|
return
|
|
return
|
|
}
|
|
}
|