fix
This commit is contained in:
@@ -64,13 +64,15 @@ func (p *FsProductModel) GetProductListByTypeIds(ctx context.Context, productTyp
|
||||
func (p *FsProductModel) GetRandomProductList(ctx context.Context, limit int) (resp []FsProduct, err error) {
|
||||
err = p.db.WithContext(ctx).Model(&FsProduct{}).
|
||||
Where("`is_del` =? and `is_shelf` = ?", 0, 1).Order("RAND()").Limit(limit).Find(&resp).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
return resp,err
|
||||
}
|
||||
|
||||
func (p *FsProductModel) FindAllOnlyByIds(ctx context.Context, ids []int64) (resp []*FsProduct, err error) {
|
||||
err = p.db.WithContext(ctx).Model(&FsProduct{}).Where("`id` IN (?)", ids).Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
func (p *FsProductModel) GetRandomProductListInIds(ctx context.Context,ids []int64, limit int) (resp []FsProduct, err error) {
|
||||
err = p.db.WithContext(ctx).Model(&FsProduct{}).
|
||||
Where("`id` in (?) and `is_del` =? and `is_shelf` = ?", ids,0, 1).Order("RAND()").Limit(limit).Find(&resp).Error
|
||||
return resp,err
|
||||
}
|
||||
Reference in New Issue
Block a user