作者 陈志颖

refactor:优化分红预算

... ... @@ -8,6 +8,7 @@ import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
rawlog "log"
)
... ... @@ -69,7 +70,7 @@ func (hook SqlGeneratePrintHook) AfterQuery(c context.Context, q *pg.QueryEvent)
if constant.LOG_FRAMEWORK == "logrus" {
rawlog.Println(string(sqlStr))
} else {
//log.Logger.Debug(string(sqlStr))
log.Logger.Debug(string(sqlStr))
}
return nil
... ...
... ... @@ -271,15 +271,16 @@ func (repository *DividendsEstimateRepository) UpdateMany(dividendsEstimates []*
if _, err := tx.Model(&dividendsEstimateModels).WherePK().Update(); err != nil {
return nil, err
}
var dividendsEstimatesUpdated []*domain.DividendsEstimate
for _, dividendsEstimateModel := range dividendsEstimateModels {
if dividendsEstimate, err := transform.TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel); err != nil {
return dividendsEstimates, err
} else {
dividendsEstimatesUpdated = append(dividendsEstimatesUpdated, dividendsEstimate)
}
}
return dividendsEstimatesUpdated, nil
//var dividendsEstimatesUpdated []*domain.DividendsEstimate
//for _, dividendsEstimateModel := range dividendsEstimateModels {
// if dividendsEstimate, err := transform.TransformToDividendsEstimateDomainModelFromPgModels(dividendsEstimateModel); err != nil {
// return dividendsEstimates, err
// } else {
// dividendsEstimatesUpdated = append(dividendsEstimatesUpdated, dividendsEstimate)
// }
//}
//return dividendsEstimatesUpdated, nil
return dividendsEstimates, nil
}
func (repository *DividendsEstimateRepository) Remove(dividendsEstimate *domain.DividendsEstimate) (*domain.DividendsEstimate, error) {
... ...