Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
d2fbc5c29e
|
@ -8,7 +8,7 @@ import (
|
||||||
type FsProductTemplateElement struct {
|
type FsProductTemplateElement struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
|
||||||
Title *string `gorm:"default:'';" json:"title"` // 产品模板名称
|
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"` //
|
Main *string `gorm:"default:'';" json:"main"` //
|
||||||
Second *string `gorm:"default:'';" json:"second"` //
|
Second *string `gorm:"default:'';" json:"second"` //
|
||||||
Base *string `gorm:"default:'';" json:"base"` //
|
Base *string `gorm:"default:'';" json:"base"` //
|
||||||
|
|
|
@ -7,7 +7,7 @@ import "context"
|
||||||
func (e *FsProductTemplateElementModel) FindOneByModelId(ctx context.Context, modelId int64) (resp *FsProductTemplateElement, err error) {
|
func (e *FsProductTemplateElementModel) FindOneByModelId(ctx context.Context, modelId int64) (resp *FsProductTemplateElement, err error) {
|
||||||
err = e.db.WithContext(ctx).Model(&FsProductTemplateElement{}).
|
err = e.db.WithContext(ctx).Model(&FsProductTemplateElement{}).
|
||||||
//以前的神仙员工把表model_id变成product_template_id
|
//以前的神仙员工把表model_id变成product_template_id
|
||||||
Where("`product_template_id` = ?", modelId).
|
Where("`model_id` = ?", modelId).
|
||||||
Take(&resp).Error
|
Take(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user