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

This commit is contained in:
laodaming 2023-09-11 16:20:16 +08:00
commit 67c8c70feb
2 changed files with 4 additions and 2 deletions

View File

@ -61,7 +61,7 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
userId = userinfo.UserId userId = userinfo.UserId
} }
// 获取默认 // 获取默认
if req.Address == "" || req.Phone == "" || req.Website == "" || req.Qrcode == "" { if req.Address == "" || req.Phone == "" || req.Website == "" || req.Qrcode == "" || req.Slogan == "" {
// 没有查到先根据模版id 查询模版数据 请求算法数据 // 没有查到先根据模版id 查询模版数据 请求算法数据
productTemplateV2Model := gmodel.NewFsProductTemplateV2Model(l.svcCtx.MysqlConn) productTemplateV2Model := gmodel.NewFsProductTemplateV2Model(l.svcCtx.MysqlConn)
productTemplateV2Info, err := productTemplateV2Model.FindOne(l.ctx, req.TemplateId) productTemplateV2Info, err := productTemplateV2Model.FindOne(l.ctx, req.TemplateId)
@ -87,6 +87,9 @@ func (l *LogoCombineLogic) LogoCombine(req *types.LogoCombineReq, userinfo *auth
if req.Qrcode == "" && templateSwitchInfo.MaterialData.QRcode.IfShow { if req.Qrcode == "" && templateSwitchInfo.MaterialData.QRcode.IfShow {
req.Qrcode = templateSwitchInfo.MaterialData.QRcode.DefaultValue req.Qrcode = templateSwitchInfo.MaterialData.QRcode.DefaultValue
} }
if req.Slogan == "" && templateSwitchInfo.MaterialData.Slogan.IfShow {
req.Slogan = templateSwitchInfo.MaterialData.Slogan.DefaultValue
}
} }
res, err := l.svcCtx.Repositories.ImageHandle.LogoCombine(l.ctx, &repositories.LogoCombineReq{ res, err := l.svcCtx.Repositories.ImageHandle.LogoCombine(l.ctx, &repositories.LogoCombineReq{

View File

@ -115,7 +115,6 @@ func MetadataResourcePATCH(tx *gorm.DB, rid string, updateMetadata any, values .
WHEN metadata IS NULL THEN ? WHEN metadata IS NULL THEN ?
ELSE JSON_MERGE_PATCH(metadata, ?) ELSE JSON_MERGE_PATCH(metadata, ?)
END END
cond, ok := values[0].(string)
WHERE resource_id = '%s'` + " and " + cond + `;` WHERE resource_id = '%s'` + " and " + cond + `;`
} }