|
@@ -191,7 +191,8 @@ func (d *SafeDao) CreateSafe(data models.CmSafe) error {
|
|
|
session.Rollback()
|
|
|
return err
|
|
|
}
|
|
|
- has, err := session.Where("code = ? and bidsection_id = ?", data.Code, data.BidsectionId).Get(&data)
|
|
|
+ safe := models.CmSafe{}
|
|
|
+ has, err := session.Where("code = ? and bidsection_id = ?", data.Code, data.BidsectionId).Get(&safe)
|
|
|
// err或者code存在都回滚
|
|
|
if err != nil {
|
|
|
session.Rollback()
|