- fix bug in TmpGetJxBadCommentsByStoreId

This commit is contained in:
gazebo
2019-02-21 15:52:31 +08:00
parent bd901dcd0e
commit 9e7a41c80e

View File

@@ -626,22 +626,22 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeIDs []int, offset
`
sqlParams := []interface{}{}
if len(storeIDs) > 0 {
sql += " AND jxstoreid IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
sql += " AND t1.jxstoreid IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
sqlParams = append(sqlParams, storeIDs)
}
if commentType == GET_BAD_COMMENTS_TYPE {
sql += " AND status = ?"
sql += " AND t1.status = ?"
sqlParams = append(sqlParams, commentType)
}
if !utils.IsTimeZero(fromTime) {
sql += " AND createtime >= ?"
sql += " AND t1.createtime >= ?"
sqlParams = append(sqlParams, fromTime)
}
if !utils.IsTimeZero(toTime) {
sql += " AND createtime < ?"
sql += " AND t1.createtime < ?"
sqlParams = append(sqlParams, toTime)
}
sql += " ORDER BY createtime DESC"
sql += " ORDER BY t1.createtime DESC"
pageSize = jxutils.FormalizePageSize(pageSize)
if offset < 0 {
offset = 0