caipin 1 year ago
parent
commit
7d6a653142
2 changed files with 5 additions and 0 deletions
  1. 2 0
      models/cm_tree.go
  2. 3 0
      services/tree_service.go

+ 2 - 0
models/cm_tree.go

@@ -36,4 +36,6 @@ type CmTree struct {
 	Isdelete                   int       `xorm:"not null comment('1删除') TINYINT(1)"`
 	CreateTime                 time.Time `xorm:"comment('创建时间') DATETIME"`
 	UpdateTime                 time.Time `xorm:"not null default 'CURRENT_TIMESTAMP' comment('更新时间') TIMESTAMP"`
+
+	ContractDeductionTotal string `xorm:"not null comment('总扣款金额') DECIMAL(12,2)"`
 }

+ 3 - 0
services/tree_service.go

@@ -225,6 +225,9 @@ func (s *treeService) GetAllContract(projectId int, account *models.CmProjectAcc
 			folder.ContractsIncome = utils.PriceToStringFormat(contractsIncome)
 			folder.ContractsReturned = utils.PriceToStringFormat(contractsReturned)
 
+			contractDeductionTotal, _ := strconv.ParseFloat(data.ContractDeductionTotal, 64)
+			folder.ContractDeductionTotal = utils.PriceToStringFormat(contractDeductionTotal)
+
 			// 汇款进度
 			ContractsIncome, err := strconv.ParseFloat(data.ContractsIncome, 64)
 			if err != nil {