- use JxBadCommentsEx in TmpGetJxBadCommentsByStoreId
This commit is contained in:
@@ -45,6 +45,12 @@ type StoresInfo struct {
|
|||||||
Stores []*StoreExt `json:"stores"`
|
Stores []*StoreExt `json:"stores"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type JxBadCommentsEx struct {
|
||||||
|
legacymodel.JxBadComments
|
||||||
|
StoreName string `json:"storeName"`
|
||||||
|
CityName string `json:"cityName"`
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ErrMissingInput = errors.New("没有有效的输入参数")
|
ErrMissingInput = errors.New("没有有效的输入参数")
|
||||||
ErrCanNotFindVendor = errors.New("vendorID参数不合法")
|
ErrCanNotFindVendor = errors.New("vendorID参数不合法")
|
||||||
@@ -611,8 +617,11 @@ func TmpGetJxBadCommentsNo(ctx *jxcontext.Context, storeID int) (count int, 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, storeIDs []int, offset, pageSize, commentType int, fromTime, toTime time.Time) (retVal map[string]interface{}, err error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
sql := `
|
sql := `
|
||||||
SELECT SQL_CALC_FOUND_ROWS *
|
SELECT SQL_CALC_FOUND_ROWS
|
||||||
FROM jx_bad_comments
|
t1.*, t2.name store_name, t3.name city_name
|
||||||
|
FROM jx_bad_comments t1
|
||||||
|
LEFT JOIN store t2 ON t2.id = t1.jxstoreid
|
||||||
|
JOIN place t3 ON t3.code = t2.city_code
|
||||||
WHERE 1 = 1
|
WHERE 1 = 1
|
||||||
`
|
`
|
||||||
sqlParams := []interface{}{}
|
sqlParams := []interface{}{}
|
||||||
@@ -639,7 +648,7 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeIDs []int, offset
|
|||||||
}
|
}
|
||||||
sql += " LIMIT ? OFFSET ?"
|
sql += " LIMIT ? OFFSET ?"
|
||||||
sqlParams = append(sqlParams, pageSize, offset)
|
sqlParams = append(sqlParams, pageSize, offset)
|
||||||
var commentList []*legacymodel.JxBadComments
|
var commentList []*JxBadCommentsEx
|
||||||
dao.Begin(db)
|
dao.Begin(db)
|
||||||
defer func() {
|
defer func() {
|
||||||
dao.Rollback(db)
|
dao.Rollback(db)
|
||||||
|
|||||||
Reference in New Issue
Block a user