- add TmpGetJxBadComments

This commit is contained in:
gazebo
2019-02-21 09:47:22 +08:00
parent b6f72b6eb3
commit 324bc5ea7b
3 changed files with 41 additions and 7 deletions

View File

@@ -608,7 +608,7 @@ func TmpGetJxBadCommentsNo(ctx *jxcontext.Context, storeID int) (count int, err
return count, err
}
func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeID, pageNo, pageSize, commentType int, fromTime, toTime time.Time) (retVal map[string]interface{}, err error) {
func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeIDs []int, offset, pageSize, commentType int, fromTime, toTime time.Time) (retVal map[string]interface{}, err error) {
db := dao.GetDB()
sql := `
SELECT SQL_CALC_FOUND_ROWS *
@@ -616,9 +616,9 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeID, pageNo, pageS
WHERE 1 = 1
`
sqlParams := []interface{}{}
if storeID > 0 {
sql += " AND jxstoreid = ?"
sqlParams = append(sqlParams, storeID)
if len(storeIDs) > 0 {
sql += " AND jxstoreid IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
sqlParams = append(sqlParams, storeIDs)
}
if commentType == GET_BAD_COMMENTS_TYPE {
sql += " AND status = ?"
@@ -634,7 +634,6 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeID, pageNo, pageS
}
sql += " ORDER BY createtime DESC"
pageSize = jxutils.FormalizePageSize(pageSize)
offset := (pageNo - 1) * pageSize
if offset < 0 {
offset = 0
}