|
@@ -309,14 +309,15 @@ func AdminExamRecordDetail(id int) *result.Result {
|
|
|
|
|
|
// 题目答案, 用户答案
|
|
|
sqlStr := "select er.answer from exam_record er where er.id = ? and er.delete_at is null"
|
|
|
- var answerStr string
|
|
|
+ // ! 20240305 这里修改answer为*string类型 数据库为null值会报错
|
|
|
+ var answerStr *string
|
|
|
err := config.DB.Get(&answerStr, sqlStr, id)
|
|
|
if err != nil {
|
|
|
return result.UNKNOW_ERROR.SetMsg(err.Error())
|
|
|
}
|
|
|
|
|
|
var avs []*vo.AnswerVo
|
|
|
- err = json.Unmarshal([]byte(answerStr), &avs)
|
|
|
+ err = json.Unmarshal([]byte(*answerStr), &avs)
|
|
|
if err != nil {
|
|
|
return result.FORMATE_ERROR
|
|
|
}
|