Browse Source

fix:修改

duxin 2 năm trước cách đây
mục cha
commit
80155e4c82

+ 13 - 11
jyBXSubscribe/rpc/internal/logic/bypushhistorylogic.go

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"context"
-	"fmt"
 	"github.com/zeromicro/go-zero/core/logx"
 	IC "jyBXSubscribe/rpc/init"
 	"jyBXSubscribe/rpc/internal/svc"
@@ -50,21 +49,24 @@ func (l *ByPushHistoryLogic) ByPushHistory(in *bxsubscribe.SubscribeInfosReq) (*
 		FileExists:    in.FileExists, //是否有附件
 	}
 	if selectIds := strings.TrimSpace(in.SelectIds); selectIds != "" {
-		encodeArr := strings.Split(selectIds, ",")
-		idArr := make([]string, 0, len(encodeArr))
-		for _, encodeId := range encodeArr {
-			if tmp := util.DecodeId(encodeId); tmp != "" {
-				idArr = append(idArr, tmp)
-			}
-		}
-		spqp.SelectInfoIds = idArr
+		//encodeArr := strings.Split(selectIds, ",")
+		//idArr := make([]string, 0, len(encodeArr))
+		//for _, encodeId := range encodeArr {
+		//	if tmp := util.DecodeId(encodeId); tmp != "" {
+		//		idArr = append(idArr, tmp)
+		//	}
+		//}
+		spqp.SelectInfoIds = strings.Split(selectIds, ",")
 	}
 	_, _, list := model.NewSubscribePush(vipType).Datas(spqp)
 	if list == nil || len(list) == 0 {
-		return nil, fmt.Errorf("未匹配到导出数据")
+		return &bxsubscribe.ByPushHistoryResp{
+			ErrorCode: 1,
+			ErrorMsg:  "未查询到数据",
+		}, nil
 	}
 	ids := make([]string, 0, len(list))
-	keyWords := make([]string, len(list), len(list))
+	keyWords := make([]string, 0, len(list))
 	for _, pushData := range list {
 		if pushData.XId != "" {
 			if xid := util.EncodeId(pushData.XId); len(xid) > 0 {

+ 1 - 1
jyBXSubscribe/rpc/model/push.go

@@ -314,7 +314,7 @@ func (s *subscribePush) Datas(spqp *SubPushQueryParam) (hasNextPage bool, total
 func (s *subscribePush) getDatasFromMysql(spqp *SubPushQueryParam, starttime, endtime int64, size int, isLimit bool) (result []*bxsubscribe.SubscribeInfo, count int64) {
 	querys := []string{}
 	if len(spqp.SelectInfoIds) != 0 {
-		querys = append(querys, fmt.Sprintf("id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
+		querys = append(querys, fmt.Sprintf("a.id in ('%s')", strings.Join(spqp.SelectInfoIds, "','")))
 	} else {
 		if spqp.IsEnt {
 			querys = []string{fmt.Sprintf("a.entid='%s'", spqp.EntId)}