|
@@ -9,6 +9,7 @@ package dao
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"errors"
|
|
|
+ "log"
|
|
|
|
|
|
"github.com/go-xorm/xorm"
|
|
|
"go.mod/lib"
|
|
@@ -59,6 +60,7 @@ func (d *BidAccountDao) Create(bidsectionId int, accountData *models.CmProjectAc
|
|
|
_, err = session.Exec("UPDATE cm_tree SET `accounts` = ? where id = ?", accounts, treeId)
|
|
|
if err != nil {
|
|
|
session.Rollback()
|
|
|
+ log.Println(err)
|
|
|
return errors.New("更新标段成员量出错")
|
|
|
}
|
|
|
|
|
@@ -72,12 +74,14 @@ func (d *BidAccountDao) Create(bidsectionId int, accountData *models.CmProjectAc
|
|
|
bidsectionIds[0].Id = bidsectionId
|
|
|
bidsectionIdsByte, err = json.Marshal(bidsectionIds)
|
|
|
if err != nil {
|
|
|
+ session.Rollback()
|
|
|
return err
|
|
|
}
|
|
|
} else {
|
|
|
// 2.获得已有的标段ID
|
|
|
err := json.Unmarshal([]byte(bidsectionIdsString), &bidsectionIds)
|
|
|
if err != nil {
|
|
|
+ session.Rollback()
|
|
|
return err
|
|
|
}
|
|
|
bidId := lib.BidsectionIds{}
|