作者 陈志颖

fix:模糊查询字段拼接

... ... @@ -108,6 +108,9 @@ func newQueryOptionV2(request *protocolx.PartnersRequest) map[string]interface{}
if request.EndTime > 0 {
queryOption["endTime"] = request.EndTime / 1000
}
if request.Keyword != "" {
queryOption["keyword"] = request.Keyword
}
queryOption["limit"] = request.PageSize
queryOption["offset"] = request.PageSize * request.PageIndex
... ...
... ... @@ -96,8 +96,8 @@ func (dao *PartnerInfoDao) Partners(partnerIds []int64, queryOptions map[string]
if endTime, ok := queryOptions["endTime"]; ok {
filterPartners.WriteString(fmt.Sprintf(" and cooperate_time<to_timestamp(%v)", endTime))
}
if keyword, ok := queryOptions["keyword"]; ok {
filterPartners.WriteString(fmt.Sprintf(" and partner_name LIKE %v", keyword))
if keyword, ok := queryOptions["keyword"]; ok && keyword.(string) != "" {
filterPartners.WriteString(fmt.Sprintf(` and partner_name LIKE '%v'`, fmt.Sprintf("%%%s%%", "%%" + keyword.(string) + "%")))
}
sql.WriteString(fmt.Sprintf(`
... ...
... ... @@ -26,8 +26,8 @@ func CreateResponseLogFilter(logger *logs.BeeLogger) func(ctx *context.Context)
return func(ctx *context.Context) {
requestId := ctx.Request.Header.Get("requestId")
body, _ := json.Marshal(ctx.Input.GetData("outputData"))
if len(body) > 1000 {
body = body[:1000]
if len(body) > 10000 {
body = body[:10000]
}
logger.Debug(fmt.Sprintf("<====Send RequestId:%v BodyData:%s", requestId, body))
}
... ...