TmpGetJxBadComments添加可选参数keyword
This commit is contained in:
@@ -1123,7 +1123,7 @@ func TmpGetJxBadCommentsNo(ctx *jxcontext.Context, storeID int) (count int, err
|
||||
return count, err
|
||||
}
|
||||
|
||||
func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeIDs []int, offset, pageSize, commentType int, fromTime, toTime time.Time) (retVal map[string]interface{}, err error) {
|
||||
func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, 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
|
||||
@@ -1136,6 +1136,13 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeIDs []int, offset
|
||||
WHERE 1 = 1
|
||||
`
|
||||
sqlParams := []interface{}{}
|
||||
if keyword != "" {
|
||||
keywordLike := "%" + keyword + "%"
|
||||
sql += `
|
||||
AND (t1.order_id LIKE ? OR t1.jxstoreid LIKE ? OR t1.userphone LIKE ? OR t1.scorecontent LIKE ? OR t1.vendertags LIKE ? OR t1.updated_scorecontent LIKE ?
|
||||
OR t1.updated_vendertags LIKE ? OR t2.name LIKE ?)`
|
||||
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike)
|
||||
}
|
||||
if len(storeIDs) > 0 {
|
||||
sql += " AND t1.jxstoreid IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
|
||||
sqlParams = append(sqlParams, storeIDs)
|
||||
|
||||
Reference in New Issue
Block a user