正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
@@ -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 | } |
-
请 注册 或 登录 后发表评论