fix
This commit is contained in:
@@ -75,6 +75,21 @@ func (l *GetProductInfoLogic) GetProductInfo(req *types.GetProductInfoReq, login
|
||||
logx.Error(err)
|
||||
return &types.Response{Code: 510, Message: "failed to get product models"}
|
||||
}
|
||||
modelIds := make([]string, 0, len(models))
|
||||
for _, v := range models {
|
||||
modelIds = append(modelIds, fmt.Sprintf("%d", v.Id))
|
||||
}
|
||||
//通过产品id和模型id获取模板信息
|
||||
productTemplateV2Model := model.NewFsProductTemplateV2Model(l.svcCtx.MysqlConn)
|
||||
templateV2List, err := productTemplateV2Model.FindAllByModelIdsProduct(l.ctx, modelIds, productInfo.Id, 2)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return &types.Response{Code: 510, Message: "failed to get templates"}
|
||||
}
|
||||
//获取模板包含的model_id
|
||||
templateModelIds := make([]string, 0, len(templateV2List))
|
||||
for _, v := range templateV2List {
|
||||
templateModelIds = append(templateModelIds, fmt.Sprintf("%d", v.ModelId))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq, login
|
||||
}
|
||||
//获取模板
|
||||
productTemplateModel := model.NewFsProductTemplateV2Model(l.svcCtx.MysqlConn)
|
||||
productTemplatesV2, err := productTemplateModel.FindAllByCondition(l.ctx, productIds, 0, 1)
|
||||
productTemplatesV2, err := productTemplateModel.FindAllByCondition(l.ctx, productIds)
|
||||
if err != nil {
|
||||
logx.Error(err)
|
||||
return &types.Response{Code: 510, Message: "get product template_v2 err"}
|
||||
|
||||
Reference in New Issue
Block a user