Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop

This commit is contained in:
eson 2023-09-08 19:11:09 +08:00
commit 0d72ac98a0
2 changed files with 5 additions and 1 deletions

View File

@ -116,7 +116,7 @@ func (t *FsProductTemplateV2Model) GetProductTemplateListByParams(ctx context.Co
// 获取开启云渲染模板 // 获取开启云渲染模板
func (t *FsProductTemplateV2Model) FindOneCloudRenderByProductIdModelIdTemplateTag(ctx context.Context, productId, modelId int64, templateTag string) (resp *FsProductTemplateV2, err error) { func (t *FsProductTemplateV2Model) FindOneCloudRenderByProductIdModelIdTemplateTag(ctx context.Context, productId, modelId int64, templateTag string) (resp *FsProductTemplateV2, err error) {
err = t.db.WithContext(ctx).Model(&FsProductTemplateV2{}). err = t.db.WithContext(ctx).Model(&FsProductTemplateV2{}).
Where("product_id = ? and model_id = ? and template_tag = ? and element_model_id > ? ", productId, modelId, templateTag, 0). Where("product_id = ? and model_id = ? and template_tag = ? ", productId, modelId, templateTag).
Where("status = ? and is_del = ?", 1, 0). Where("status = ? and is_del = ?", 1, 0).
Order("sort ASC"). Order("sort ASC").
Take(&resp).Error Take(&resp).Error

View File

@ -286,6 +286,10 @@ func (w *wsConnectItem) getProductRelateionInfo(renderImageData websocket_data.R
logx.Error("failed to get template info:", err) logx.Error("failed to get template info:", err)
return nil, nil, nil, err return nil, nil, nil, err
} }
if *productTemplate.ElementModelId <= 0 {
w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "模板未开启云渲染", renderImageData.RenderData.ProductId, w.userId, w.guestId, productTemplate.Id, model3d.Id, productSize.Id, 0)
return nil, nil, nil, errors.New("模板未开启云渲染")
}
if productTemplate.TemplateInfo == nil || *productTemplate.TemplateInfo == "" { if productTemplate.TemplateInfo == nil || *productTemplate.TemplateInfo == "" {
w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "渲染模板的json设计信息是空的", renderImageData.RenderData.ProductId, w.userId, w.guestId, productTemplate.Id, model3d.Id, productSize.Id, 0) w.renderErrResponse(renderImageData.RenderId, renderImageData.RenderData.TemplateTag, "", "渲染模板的json设计信息是空的", renderImageData.RenderData.ProductId, w.userId, w.guestId, productTemplate.Id, model3d.Id, productSize.Id, 0)
return nil, nil, nil, errors.New("渲染模板的json设计信息是空的") return nil, nil, nil, errors.New("渲染模板的json设计信息是空的")