fix
This commit is contained in:
@@ -94,6 +94,7 @@ func (l *AddToCartLogic) AddToCart(req *types.AddToCartReq, userinfo *auth.UserI
|
||||
fittingName string //配件名
|
||||
lightJson interface{} //灯光设计数据
|
||||
lightName string //灯光名字
|
||||
modelJson interface{} //模型json
|
||||
)
|
||||
//有模板
|
||||
if req.TemplateId > 0 {
|
||||
@@ -174,6 +175,10 @@ func (l *AddToCartLogic) AddToCart(req *types.AddToCartReq, userinfo *auth.UserI
|
||||
if modelInfo.ModelInfo == nil || *modelInfo.ModelInfo == "" {
|
||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "the model`s design info is empty")
|
||||
}
|
||||
if err = json.Unmarshal([]byte(*modelInfo.ModelInfo), &modelJson); err != nil {
|
||||
logx.Error(err)
|
||||
return resp.SetStatusWithMessage(basic.CodeJsonErr, "failed to parse model design info")
|
||||
}
|
||||
//获取灯光信息
|
||||
if *modelInfo.Light > 0 {
|
||||
lightInfo, err := l.svcCtx.AllModels.FsProductModel3dLight.FindOne(l.ctx, *modelInfo.Light)
|
||||
@@ -208,7 +213,7 @@ func (l *AddToCartLogic) AddToCart(req *types.AddToCartReq, userinfo *auth.UserI
|
||||
TemplateTag: templateTag,
|
||||
},
|
||||
ModelInfo: gmodel.ModelInfo{
|
||||
ModelJson: *modelInfo.ModelInfo,
|
||||
ModelJson: modelJson,
|
||||
},
|
||||
FittingInfo: gmodel.FittingInfo{
|
||||
FittingJson: fittingJson,
|
||||
|
||||
@@ -196,6 +196,7 @@ func (l *GetCartsLogic) GetCarts(req *types.GetCartsReq, userinfo *auth.UserInfo
|
||||
IsSelected: *cart.IsSelected > 0,
|
||||
TemplateTag: templateTag,
|
||||
Logo: snapShot.Logo,
|
||||
RenderImage: snapShot.RenderImage,
|
||||
}
|
||||
//是否有失效的
|
||||
if description, ok := mapCartChange[cart.Id]; ok {
|
||||
|
||||
Reference in New Issue
Block a user