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

This commit is contained in:
Hiven 2023-08-17 12:14:25 +08:00
commit d2fbc5c29e
2 changed files with 21 additions and 21 deletions

View File

@ -8,7 +8,7 @@ import (
type FsProductTemplateElement struct {
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
Title *string `gorm:"default:'';" json:"title"` // 产品模板名称
ProductTemplateId *int64 `gorm:"index;default:0;" json:"product_template_id"` // 产品模板id
ModelId *int64 `gorm:"index;default:0;" json:"model_id"` // 模型id
Main *string `gorm:"default:'';" json:"main"` //
Second *string `gorm:"default:'';" json:"second"` //
Base *string `gorm:"default:'';" json:"base"` //

View File

@ -7,7 +7,7 @@ import "context"
func (e *FsProductTemplateElementModel) FindOneByModelId(ctx context.Context, modelId int64) (resp *FsProductTemplateElement, err error) {
err = e.db.WithContext(ctx).Model(&FsProductTemplateElement{}).
//以前的神仙员工把表model_id变成product_template_id
Where("`product_template_id` = ?", modelId).
Where("`model_id` = ?", modelId).
Take(&resp).Error
return resp, err
}