...
|
...
|
@@ -267,17 +267,18 @@ func GetCheckQuestionsByTemplateId(id int64) (rsp []*protocol.CheckQuestion, err |
|
|
var tmpGroupId int64
|
|
|
var idx int = 0
|
|
|
var groupIdx = 0
|
|
|
var parentId = 0
|
|
|
for i := range checks {
|
|
|
c := checks[i]
|
|
|
|
|
|
if tmpGroupId != c.Pid {
|
|
|
groupIdx++
|
|
|
idx = 0
|
|
|
parentId = i + 1
|
|
|
}
|
|
|
tmpGroupId = c.Pid
|
|
|
item := protocol.NewCheckQuestion(c.Title, getQuestionTitle(groupIdx, idx, c.Title), c.Pid, protocol.CheckOptionsCommit)
|
|
|
item.Id = c.Id
|
|
|
item.ParentId = c.ParentId
|
|
|
item.Id, item.ParentId = genCustomizeQuestionId(i, idx, int64(parentId))
|
|
|
rsp = append(rsp, item)
|
|
|
idx++
|
|
|
}
|
...
|
...
|
@@ -326,9 +327,9 @@ func GetCheckQuestionsByChanceId(header *protocol.RequestHeader, id int64) (rsp |
|
|
item.Answer = c.Answer
|
|
|
}
|
|
|
}
|
|
|
if item.Id == 0 {
|
|
|
item.Id, item.ParentId = genCustomizeQuestionId(i, idx, int64(parentId))
|
|
|
}
|
|
|
//if item.Id == 0 {
|
|
|
item.Id, item.ParentId = genCustomizeQuestionId(i, idx, int64(parentId))
|
|
|
//}
|
|
|
rsp = append(rsp, item)
|
|
|
idx++
|
|
|
}
|
...
|
...
|
|