fusenapi/model/gmodel/fs_product_template_basemap_logic.go
laodaming 89dfd58e1c fix
2023-06-21 15:06:09 +08:00

15 lines
418 B
Go

package gmodel
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
}