This commit is contained in:
laodaming
2023-10-26 11:20:28 +08:00
parent 898ead74d1
commit 43d5fe6692
2 changed files with 4 additions and 3 deletions

View File

@@ -88,10 +88,10 @@ func (p *FsProductModel) GetRandomProductList(ctx context.Context, limit int) (r
Where("`is_del` =? and `is_shelf` = ?", 0, 1).Order("RAND()").Limit(limit).Find(&resp).Error
return resp, err
}
func (p *FsProductModel) GetIgnoreRandomProductList(ctx context.Context, limit int, notInProductIds []int64) (resp []FsProduct, err error) {
func (p *FsProductModel) GetIgnoreRandomProductList(ctx context.Context, notEqType int64, limit int, notInProductIds []int64) (resp []FsProduct, err error) {
db := p.db.WithContext(ctx).Model(&FsProduct{}).
//过滤报价单产品
Where("`is_del` =? and `is_shelf` = ? and `type` != ?", 0, 1, 39)
Where("`is_del` =? and `is_shelf` = ? and `type` != ?", 0, 1, notEqType)
if len(notInProductIds) > 0 {
db = db.Where("`id` not in(?)", notInProductIds)
}