2023-06-16 07:11:37 +00:00
|
|
|
package gmodel
|
2023-06-20 11:56:18 +00:00
|
|
|
|
|
|
|
import "context"
|
|
|
|
|
|
|
|
func (l *FsProductModel3dLightModel) GetAllByIds(ctx context.Context, ids []int64) (resp []FsProductModel3dLight, err error) {
|
2023-06-25 09:11:42 +00:00
|
|
|
err = l.db.WithContext(ctx).Model(&FsProductModel3dLight{}).Where("`id` in (?) and `status` = ?", ids, 1).Find(&resp).Error
|
|
|
|
return resp, err
|
|
|
|
}
|
|
|
|
func (l *FsProductModel3dLightModel) GetAll(ctx context.Context) (resp []FsProductModel3dLight, err error) {
|
|
|
|
err = l.db.WithContext(ctx).Model(&FsProductModel3dLight{}).Where("`status` = ?", 1).Find(&resp).Error
|
|
|
|
return resp, err
|
2023-06-20 11:56:18 +00:00
|
|
|
}
|
2023-06-26 08:53:36 +00:00
|
|
|
|
|
|
|
func (l *FsProductModel3dLightModel) Create(ctx context.Context, data *FsProductModel3dLight) error {
|
|
|
|
return l.db.WithContext(ctx).Create(&data).Error
|
|
|
|
}
|
|
|
|
func (l *FsProductModel3dLightModel) Update(ctx context.Context, id int64, data *FsProductModel3dLight) error {
|
|
|
|
return l.db.WithContext(ctx).Where("`id` = ?", id).Updates(data).Error
|
|
|
|
}
|