This commit is contained in:
laodaming
2023-06-21 15:06:09 +08:00
parent 8857f84bf6
commit 89dfd58e1c
7 changed files with 127 additions and 10 deletions

View File

@@ -1,2 +1,14 @@
package gmodel
// TODO: 使用model的属性做你想做的
import "context"
// TODO: 使用model的属性做你想做的
func (bm *FsProductTemplateBasemapModel) GetAllEnabledList(ctx context.Context, fields ...string) (resp []FsProductTemplateBasemap, err error) {
db := bm.db.WithContext(ctx).Model(&FsProductTemplateBasemap{}).Where("`status` = ? ", 1)
if len(fields) != 0 {
db = db.Select(fields[0])
}
err = db.Find(&resp).Error
return resp, err
}