This commit is contained in:
laodaming
2023-08-08 18:35:29 +08:00
parent 2f1ef81263
commit 5faeacd472
4 changed files with 128 additions and 100 deletions

View File

@@ -1,3 +1,13 @@
package gmodel
import "context"
// TODO: 使用model的属性做你想做的
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).
Take(&resp).Error
return resp, err
}