Browse Source

fix:更新sql查询

duxin 3 years ago
parent
commit
b9bb9a0ec4
1 changed files with 2 additions and 3 deletions
  1. 2 3
      rpc/manager/internal/logic/infodetaillogic.go

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

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"app.yhyue.com/moapp/jyInfo/rpc/model"
-	"app.yhyue.com/moapp/jyInfo/rpc/util"
 	se "app.yhyue.com/moapp/jybase/encrypt"
 	"context"
 	"log"
@@ -51,7 +50,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 =? and a.app_id = `+util.StrFormat(in.AppId), msgId); _d != nil && len(*_d) > 0 {
+				LEFT JOIN information b on (a.related_id =b.id) where a.id =? and a.app_id = ?`, msgId, in.AppId); _d != nil && len(*_d) > 0 {
 			data = (*_d)[0]
 			var (
 				related manager.Related
@@ -74,7 +73,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 = ? and app_id = `+util.StrFormat(in.AppId), 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 {