fix:购物车下单
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// fs_order 订单表
|
||||
|
||||
@@ -37,11 +37,15 @@ func (d *FsProductModel3dModel) GetAllByIdsWithoutStatus(ctx context.Context, id
|
||||
err = db.Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
func (d *FsProductModel3dModel) GetAllByIdsTag(ctx context.Context, ids []int64, tag int64) (resp []FsProductModel3d, err error) {
|
||||
func (d *FsProductModel3dModel) GetAllByIdsTag(ctx context.Context, ids []int64, tag int64, fields ...string) (resp []FsProductModel3d, err error) {
|
||||
if len(ids) == 0 {
|
||||
return
|
||||
}
|
||||
err = d.db.WithContext(ctx).Model(&FsProductModel3d{}).Where("`id` in (?) and `status` = ? and `tag` = ?", ids, 1, tag).Find(&resp).Error
|
||||
db := d.db.WithContext(ctx).Model(&FsProductModel3d{}).Where("`id` in (?) and `status` = ? and `tag` = ?", ids, 1, tag)
|
||||
if len(fields) > 0 {
|
||||
db = db.Select(fields[0])
|
||||
}
|
||||
err = db.Find(&resp).Error
|
||||
return resp, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user