fusenapi/model/gmodel/fs_qrcode_set_logic.go

18 lines
481 B
Go
Raw Normal View History

2023-06-16 07:11:37 +00:00
package gmodel
import (
"context"
)
func (q *FsQrcodeSetModel) GetAll(ctx context.Context) (resp []FsQrcodeSet, err error) {
err = q.db.WithContext(ctx).Model(&FsQrcodeSet{}).Where("`status` = ?", 1).Find(&resp).Error
if err != nil {
return nil, err
}
return
}
2023-06-20 09:28:28 +00:00
func (q *FsQrcodeSetModel) FindOne(ctx context.Context, id int64) (resp *FsQrcodeSet, err error) {
2023-06-16 07:11:37 +00:00
err = q.db.WithContext(ctx).Model(&FsQrcodeSet{}).Where("`id` = ?", id).First(&resp).Error
2023-06-20 09:28:28 +00:00
return resp, err
2023-06-16 07:11:37 +00:00
}