Browse Source

Merge branch 'master' of http://192.168.1.41:3000/caipin/construction_management

caipin 4 years ago
parent
commit
23f340a8ec
1 changed files with 4 additions and 2 deletions
  1. 4 2
      services/rule_service.go

+ 4 - 2
services/rule_service.go

@@ -3,6 +3,7 @@ package services
 import (
 	"encoding/json"
 	"errors"
+	"fmt"
 	"log"
 	"strconv"
 
@@ -74,7 +75,8 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 		}
 		var code viewmodels.RuleCode
 		err := json.Unmarshal([]byte(rule.ContractReturnRule), &code)
-		total, err := s.daoContract.CountRuleCode(bid, 0)
+		total, err := s.daoContract.CountRuleCode(bid, 1)
+		fmt.Printf("-----------------------", total)
 		k, _ := strconv.Atoi(code.Code)
 		newCode := utils.CreateRuleCode(int64(k), total, len(code.Code))
 		return rule.ContractReturnRule, newCode, err
@@ -85,7 +87,7 @@ func (s *ruleService) AutoCode(bid int, pid int, codeType string) (string, strin
 		}
 		var code viewmodels.RuleCode
 		err := json.Unmarshal([]byte(rule.ContractPaidRule), &code)
-		total, err := s.daoContract.CountRuleCode(bid, 1)
+		total, err := s.daoContract.CountRuleCode(bid, 2)
 		k, _ := strconv.Atoi(code.Code)
 		newCode := utils.CreateRuleCode(int64(k), total, len(code.Code))
 		return rule.ContractPaidRule, newCode, err