diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 17dad5172..5ec980c5a 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -45,6 +45,12 @@ type StoresInfo struct { Stores []*StoreExt `json:"stores"` } +type JxBadCommentsEx struct { + legacymodel.JxBadComments + StoreName string `json:"storeName"` + CityName string `json:"cityName"` +} + var ( ErrMissingInput = errors.New("没有有效的输入参数") 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) { db := dao.GetDB() sql := ` - SELECT SQL_CALC_FOUND_ROWS * - FROM jx_bad_comments + SELECT SQL_CALC_FOUND_ROWS + 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 ` sqlParams := []interface{}{} @@ -639,7 +648,7 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, storeIDs []int, offset } sql += " LIMIT ? OFFSET ?" sqlParams = append(sqlParams, pageSize, offset) - var commentList []*legacymodel.JxBadComments + var commentList []*JxBadCommentsEx dao.Begin(db) defer func() { dao.Rollback(db)