Commit 0cac1efc by 彭芳

[minor]: fix customer id is 0

parent be9f8aac
...@@ -43,6 +43,6 @@ func NewGormLogger() logger.Interface { ...@@ -43,6 +43,6 @@ func NewGormLogger() logger.Interface {
return logger.New(logrus.StandardLogger(), logger.Config{ return logger.New(logrus.StandardLogger(), logger.Config{
SlowThreshold: time.Second, SlowThreshold: time.Second,
IgnoreRecordNotFoundError: true, IgnoreRecordNotFoundError: true,
LogLevel: logger.Warn, LogLevel: logger.Info,
}) })
} }
package service package service
import ( import (
"strconv"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/go-kratos/kratos/v2/log" "github.com/go-kratos/kratos/v2/log"
...@@ -25,8 +27,13 @@ func (p *ReportService) ListCampaignData(ctx *gin.Context) { ...@@ -25,8 +27,13 @@ func (p *ReportService) ListCampaignData(ctx *gin.Context) {
ResponseError(ctx, err) ResponseError(ctx, err)
return return
} }
customerId := ctx.GetInt64(util.CustomerId) customerIdStr := ctx.GetString(util.CustomerId)
data, err := p.uc.ListCampaignData(ctx, customerId, &req) customerId, err := strconv.Atoi(customerIdStr)
if err != nil {
ResponseError(ctx, err)
return
}
data, err := p.uc.ListCampaignData(ctx, int64(customerId), &req)
if err != nil { if err != nil {
ResponseError(ctx, err) ResponseError(ctx, err)
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment