TODO: 反射
This commit is contained in:
@@ -2,6 +2,7 @@ package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -29,3 +30,8 @@ func (p *FsCloudPickUpModel) SavePickUpWithTransaction(ctx context.Context, pick
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func (p *FsCloudPickUpModel) GetCloudPickUpByIDAndUserID(ctx context.Context, userId int64, RelationID int64) (cloudOrder *FsCloudPickUp, err error) {
|
||||
|
||||
return cloudOrder, err
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package gmodel
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func (o *FsOrderModel) FindOneBySn(ctx context.Context, userId int64, sn string) (resp *FsOrder, err error) {
|
||||
@@ -20,3 +22,12 @@ func (o *FsOrderModel) FindOne(ctx context.Context, userId int64, OrderId int64)
|
||||
func (o *FsOrderModel) Update(ctx context.Context, data *FsOrder) error {
|
||||
return o.db.WithContext(ctx).Model(data).Where("`id` = ?", data.Id).Updates(data).Error
|
||||
}
|
||||
|
||||
func (o *FsOrderModel) FindOneAndCreateServiceContact(ctx context.Context, userId int64, OrderId int64) (order *FsOrder, err error) {
|
||||
err = o.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||
err = tx.Model(order).Where("`user_id` = ? and `id` = ?", userId, OrderId).Take(&order).Error
|
||||
tx.Table("").Model(FsContactService{})
|
||||
return err
|
||||
})
|
||||
return order, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user