15 lines
418 B
Go
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
|
|
}
|