浏览代码

Merge branch 'dev1.0.0' of https://app.yhyue.com/moapp/jyInfo into dev1.0.0

wangshan 3 年之前
父节点
当前提交
3bd105e4f6

+ 5 - 4
rpc/consumer/internal/logic/infochangelogic.go

@@ -50,7 +50,7 @@ func (l *InfoChangeLogic) InfoChange(in *consumer.InfoDetailReq) (*consumer.Info
 
 		if in.MsgType == 1 || in.MsgType == 2 {
 			if _d := model.Mysql.SelectBySql(`SELECT a.*,b.title as relatedTitle FROM information a
-				LEFT JOIN information b on (a.related_id =b.id) where a.id = ?`, mc.IntAll(msgId)); _d != nil && len(*_d) > 0 {
+				LEFT JOIN information b on (a.related_id =b.id) where a.id = ? and app_id = ?`, mc.IntAll(msgId), in.AppId); _d != nil && len(*_d) > 0 {
 				data = (*_d)[0]
 				var (
 					Related consumer.Related
@@ -75,7 +75,7 @@ func (l *InfoChangeLogic) InfoChange(in *consumer.InfoDetailReq) (*consumer.Info
 			}
 
 		} else if in.MsgType == 3 {
-			if _d := model.Mysql.SelectBySql(`SELECT * FROM supply_info where id = ?`, mc.IntAll(msgId)); _d != nil && len(*_d) > 0 {
+			if _d := model.Mysql.SelectBySql(`SELECT * FROM supply_info where id = ? and app_id = ?`, mc.IntAll(msgId), in.AppId); _d != nil && len(*_d) > 0 {
 				data = (*_d)[0]
 				Results.ValidityTime = mc.InterfaceToStr(data["validity_time"])
 			} else {
@@ -112,8 +112,10 @@ func (l *InfoChangeLogic) InfoChange(in *consumer.InfoDetailReq) (*consumer.Info
 		Results.InfoDetailContact = &InfoDetailContact
 		dataRes.Results = &Results
 	case 1:
+		query["id"] = mc.IntAll(msgId)
+		query["app_id"] = in.AppId
 		if in.MsgType == 1 || in.MsgType == 2 {
-			query["id"] = mc.IntAll(msgId)
+
 			if data := model.Mysql.FindOne("information", query, "", ""); data != nil && len(*data) > 0 {
 				upQuery["is_del"] = -1
 				if !model.Mysql.Update("information", query, upQuery) {
@@ -133,7 +135,6 @@ func (l *InfoChangeLogic) InfoChange(in *consumer.InfoDetailReq) (*consumer.Info
 				dataRes.ErrMsg = "查询数据失败"
 			}
 		} else if in.MsgType == 3 {
-			query["id"] = mc.IntAll(msgId)
 			if data := model.Mysql.FindOne("supply_info", query, "", ""); data != nil && len(*data) > 0 {
 				upQuery["is_del"] = -1
 				if !model.Mysql.Update("supply_info", query, upQuery) {

+ 11 - 9
rpc/consumer/internal/logic/inforelatedlogic.go

@@ -30,23 +30,25 @@ func NewInfoRelatedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InfoR
 func (l *InfoRelatedLogic) InfoRelated(in *consumer.UserIdReq) (*consumer.InfoRelatedResp, error) {
 	// todo: add your logic here and delete this line
 	var (
-		quryname string
-		resq     consumer.InfoRelatedResp
+		queryName string
+		resp      consumer.InfoRelatedResp
 	)
-	quryname = ` and type=` + mc.InterfaceToStr(in.MsqType)
+	queryName = ` and type=` + mc.InterfaceToStr(in.MsqType)
 	if in.Match != "" {
-		quryname = ` and title LIKE '%` + in.Match + `%' `
+		queryName = ` and title LIKE '%` + in.Match + `%' `
 	}
-
-	allData := model.Mysql.SelectBySql(`SELECT id,title from information WHERE user_id="` + in.UserId + `" and published=2 and is_del=1` + quryname + ` order by create_time desc limit 50`)
+	if in.AppId != 0 {
+		queryName = ` and app_id = ` + mc.InterfaceToStr(in.AppId)
+	}
+	allData := model.Mysql.SelectBySql(`SELECT id,title from information WHERE user_id="` + in.UserId + `" and published=2 and is_del=1` + queryName + ` order by create_time desc limit 50`)
 	if allData == nil || len(*allData) == 0 {
-		return &resq, nil
+		return &resp, nil
 	}
 	for _, v := range *allData {
 		var data consumer.InfoData
 		data.Id = se.SE.EncodeString(mc.InterfaceToStr(v["id"])) //关联信息加密
 		data.Title = mc.InterfaceToStr(v["title"])
-		resq.Data = append(resq.Data, &data)
+		resp.Data = append(resp.Data, &data)
 	}
-	return &resq, nil
+	return &resp, nil
 }

+ 3 - 0
rpc/consumer/internal/logic/mypublishlistlogic.go

@@ -40,6 +40,9 @@ func (l *MyPublishListLogic) MyPublishList(in *consumer.MyPublishListReq) (*cons
 	if in.MsgType != 0 {
 		queryName = queryName + ` and type=` + mc.InterfaceToStr(in.MsgType)
 	}
+	if in.AppId != 0 {
+		queryName = queryName + ` and app_id =` + mc.InterfaceToStr(in.AppId)
+	}
 	if in.PageIndex == 1 {
 		//全部
 		amount = model.Mysql.CountBySql(`SELECT count(1)  from (SELECT id from information WHERE is_del = 1  and user_id= "` + in.UserId + `" ` + queryName + `

+ 2 - 2
rpc/manager/internal/logic/infodetaillogic.go

@@ -49,7 +49,7 @@ func (l *InfoDetailLogic) InfoDetail(in *manager.InfoDetailReq) (*manager.InfoDe
 	switch in.Type {
 	case 1, 2:
 		if _d := model.Mysql.SelectBySql(`SELECT a.*,b.title as relatedTitle FROM information a 
-				LEFT JOIN information b on (a.related_id =b.id) where a.id =?`, msgId); _d != nil && len(*_d) > 0 {
+				LEFT JOIN information b on (a.related_id =b.id) where a.id =? and app_id = ?`, msgId, in.AppId); _d != nil && len(*_d) > 0 {
 			data = (*_d)[0]
 			var (
 				related manager.Related
@@ -72,7 +72,7 @@ func (l *InfoDetailLogic) InfoDetail(in *manager.InfoDetailReq) (*manager.InfoDe
 			goto env
 		}
 	case 3:
-		if _d := model.Mysql.SelectBySql(`SELECT * FROM supply_info where id = ?`, msgId); _d != nil && len(*_d) > 0 {
+		if _d := model.Mysql.SelectBySql(`SELECT * FROM supply_info where id = ? and app_id = ?`, msgId, in.AppId); _d != nil && len(*_d) > 0 {
 			data = (*_d)[0]
 			infoData.ValidityTime = common.InterfaceToStr(data["validity_time"])
 		} else {

+ 2 - 2
rpc/manager/internal/logic/institutionsfreezelogic.go

@@ -29,8 +29,8 @@ func (l *InstitutionsFreezeLogic) InstitutionsFreeze(in *manager.InstitutionsFre
 	// todo: add your logic here and delete this line
 	var resp manager.InfoResp
 
-	model.Mysql.SelectBySql(`UPDATE information SET status = -1 ,review_desc = "机构已冻结" WHERE status IN (0,1,2) and province =1 and is_del = 1 and ent_id = ` + in.EntId)
-	model.Mysql.SelectBySql(`UPDATE supply_info SET status = -1 ,review_desc = "机构已冻结" WHERE status IN (0,1,2) and province =1 and is_del = 1 and ent_id = ` + in.EntId)
+	model.Mysql.SelectBySql(`UPDATE information SET status = -1 ,review_desc = "机构已冻结" WHERE status IN (0,1,2) and province =1 and is_del = 1 and app_id = ? and ent_id = `+in.EntId, in.AppId)
+	model.Mysql.SelectBySql(`UPDATE supply_info SET status = -1 ,review_desc = "机构已冻结" WHERE status IN (0,1,2) and province =1 and is_del = 1  and app_id = ? and ent_id = `+in.EntId, in.AppId)
 
 	return &resp, nil
 }