|
@@ -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
|