fix
This commit is contained in:
@@ -79,3 +79,11 @@ func (c *FsCartModel) GetAllByUserId(ctx context.Context, userId int64, sort str
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (c *FsCartModel) GetUserCartsByIds(ctx context.Context, userId int64, ids []int64) (resp []FsCart, err error) {
|
||||
if userId <= 0 || len(ids) == 0 {
|
||||
return
|
||||
}
|
||||
err = c.db.WithContext(ctx).Model(&FsCart{}).Where("`id` in (?) and `user_id` = ?", ids, userId).Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
@@ -102,3 +102,14 @@ func (c *FsProductPriceModel) GetAllSelectBySizeId(ctx context.Context, sizeIds
|
||||
}
|
||||
return prices, err
|
||||
}
|
||||
func (p *FsProductPriceModel) GetPriceListByIds(ctx context.Context, Ids []int64) (resp []FsProductPrice, err error) {
|
||||
if len(Ids) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
db := p.db.WithContext(ctx).Model(&FsProductPrice{}).
|
||||
Where("`id` in (?)", Ids)
|
||||
if err = db.Find(&resp).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user