浏览代码

sql表名替换

WH01243 2 年之前
父节点
当前提交
d08218ebe7

+ 2 - 1
jyBXSubscribe/rpc/internal/logic/getsubsomeinfologic.go

@@ -4,6 +4,7 @@ import (
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/redis"
 	"context"
+	"fmt"
 	IC "jyBXSubscribe/rpc/init"
 	"jyBXSubscribe/rpc/model"
 	"strconv"
@@ -81,7 +82,7 @@ func (l *GetSubSomeInfoLogic) GetSubSomeInfo(in *bxsubscribe.SomeInfoReq) (*bxsu
 			today_1 := t.Unix()
 			today_2 := t.AddDate(0, 0, 1).Unix()
 			//错误
-			if IC.BaseServiceMysql.CountBySql("select count(1) as count from pushsubscribe a left join global_common_data.dws_f_bid_baseinfo b on a.infoid=b.infoid   where a.isvip =1 and a.userid =? and b.buyerclass_code=?  and (a.date between ? and ? )", common.InterfaceToStr(in.NewUserId), 93, today_1, today_2) > 0 {
+			if IC.BaseServiceMysql.CountBySql(fmt.Sprintf("select count(1) as count from %s a left join global_common_data.dws_f_bid_baseinfo b on a.infoid=b.infoid   where a.isvip =1 and a.userid =? and b.buyerclass_code=?  and (a.date between ? and ? )", common.InterfaceToStr(in.NewUserId), 93, today_1, today_2), model.NewSubscribePush("vType")) > 0 {
 				resp.Data.OtherFlag = true
 			}
 		} else {

+ 2 - 2
jyBXSubscribe/rpc/internal/logic/getviewstatuslogic.go

@@ -43,7 +43,7 @@ func (l *GetViewStatusLogic) GetViewStatus(in *bxsubscribe.GetViewStatusReq) (*b
 	in.InfoId = util.DecodeId(in.InfoId)
 	log.Println("查看状态参数", in)
 	res := new(bxsubscribe.ViewStatusResp)
-	finsql = `SELECT userid,isvisit,visittime,date FROM pushentniche where  infoid =? and source in (2,3) order By date asc`
+	finsql = `SELECT userid,isvisit,visittime,date FROM push.pushentniche where  infoid =? and source in (2,3) order By date asc`
 	if user.Role_admin_department {
 		users = model.GetDisUsers(common.IntAll(in.EntId), user.Dept.Id)
 		if users != nil && len(*users) > 0 {
@@ -60,7 +60,7 @@ func (l *GetViewStatusLogic) GetViewStatus(in *bxsubscribe.GetViewStatusReq) (*b
 		users = model.GetEntUsers(common.IntAll(in.EntId))
 	}
 	if len(ss) > 0 {
-		finsql = fmt.Sprintf(`SELECT userid,isvisit,visittime,date FROM pushentniche where  infoid =? and source in (2,3) %s order By date asc`, fmt.Sprintf(`and userid in (%s)`, strings.Join(ss, ",")))
+		finsql = fmt.Sprintf(`SELECT userid,isvisit,visittime,date FROM push.pushentniche where  infoid =? and source in (2,3) %s order By date asc`, fmt.Sprintf(`and userid in (%s)`, strings.Join(ss, ",")))
 	}
 	data := IC.BaseServiceMysql.SelectBySql(finsql, in.InfoId)
 	userMap := make(map[int]string)

+ 3 - 3
jyBXSubscribe/rpc/internal/logic/msgdistributorlogic.go

@@ -50,7 +50,7 @@ func (l *MsgDistributorLogic) MsgDistributor(in *bxsubscribe.MsgDistributorReq)
 		return &bxsubscribe.StatusResp{ErrorCode: -1, ErrorMsg: "缺少参数"}, nil
 	}
 	//获取分发信息的地区
-	infoRes := IC.BaseServiceMysql.SelectBySql(fmt.Sprintf("SELECT infoid FROM pushentniche WHERE id in('%s')", strings.Join(pushIds, "','")))
+	infoRes := IC.BaseServiceMysql.SelectBySql(fmt.Sprintf("SELECT infoid FROM push.pushentniche WHERE id in('%s')", strings.Join(pushIds, "','")))
 	if infoRes == nil || len(*infoRes) == 0 {
 		return &bxsubscribe.StatusResp{ErrorCode: -1, ErrorMsg: "获取分发地区异常"}, nil
 	}
@@ -80,7 +80,7 @@ func (l *MsgDistributorLogic) MsgDistributor(in *bxsubscribe.MsgDistributorReq)
 		}
 	}
 	//查询分发信息内容
-	msgRes := IC.BaseServiceMysql.SelectBySql(fmt.Sprintf("SELECT * FROM pushentniche WHERE id in ('%s') and entid =?  ", strings.Join(pushIds, "','")), in.EntId)
+	msgRes := IC.BaseServiceMysql.SelectBySql(fmt.Sprintf("SELECT * FROM push.pushentniche WHERE id in ('%s') and entid =?  ", strings.Join(pushIds, "','")), in.EntId)
 	if msgRes == nil || len(*msgRes) == 0 {
 		return &bxsubscribe.StatusResp{ErrorCode: -1, ErrorMsg: "获取分发信息内容异常"}, nil
 	}
@@ -98,7 +98,7 @@ func (l *MsgDistributorLogic) MsgDistributor(in *bxsubscribe.MsgDistributorReq)
 				insertValue = append(insertValue, msgValues...)
 				insertValue = append(insertValue, []interface{}{3, dateNew, uid, nil, nil, m["id"]}...)
 			}
-			affected, _ := IC.BaseServiceMysql.InsertBatchByTx(tx, "pushentniche", insertRow, insertValue)
+			affected, _ := IC.BaseServiceMysql.InsertBatchByTx(tx, "push.pushentniche", insertRow, insertValue)
 			if affected == 0 {
 				return false
 			}