作者 tangxvhui

bug 修复

@@ -3,6 +3,7 @@ package models @@ -3,6 +3,7 @@ package models
3 import ( 3 import (
4 "encoding/json" 4 "encoding/json"
5 "fmt" 5 "fmt"
  6 + "strings"
6 "time" 7 "time"
7 8
8 "github.com/astaxie/beego/orm" 9 "github.com/astaxie/beego/orm"
@@ -136,7 +137,8 @@ func (m *Chance) GetSelfCheckData() []ChanceSelfCheckData { @@ -136,7 +137,8 @@ func (m *Chance) GetSelfCheckData() []ChanceSelfCheckData {
136 } else { 137 } else {
137 json.Unmarshal([]byte(m.SelfChecks), &data) 138 json.Unmarshal([]byte(m.SelfChecks), &data)
138 for i := range data { 139 for i := range data {
139 - if data[i].Answer == "否" && len(data[i].Reason) > 0 { 140 + reason := strings.TrimSpace(data[i].Reason)
  141 + if data[i].Answer == "否" && len(reason) > 0 {
140 data[i].Answer = fmt.Sprintf("否,理由:%s", data[i].Reason) 142 data[i].Answer = fmt.Sprintf("否,理由:%s", data[i].Reason)
141 } 143 }
142 } 144 }