Commit 7fee32bb authored by szh's avatar szh

update

parent 9a93ed71
...@@ -10,8 +10,8 @@ import ( ...@@ -10,8 +10,8 @@ import (
type CourseSignup struct { type CourseSignup struct {
global.GVA_MODEL global.GVA_MODEL
Uid *int `json:"uid" form:"uid" gorm:"column:uid;comment:用户;size:10;"` Uid *int `json:"uid" form:"uid" gorm:"column:uid;comment:用户;size:10;"`
Cid *int `json:"cid" form:"cid" gorm:"column:cid;comment:课程;size:10;"` Cid *int `json:"cid" form:"cid" gorm:"column:cid;index;comment:课程;size:10;"`
IsPass *bool `json:"isPass" form:"isPass" gorm:"column:is_pass;comment:通过 0 未 1 通过;"` IsPass *bool `json:"isPass" form:"isPass" gorm:"column:is_pass;default:0;comment:通过 0 未 1 通过;"`
Addr string `json:"addr" form:"addr" gorm:"-"` Addr string `json:"addr" form:"addr" gorm:"-"`
CourseName string `json:"courseName" form:"courseName" gorm:"-"` CourseName string `json:"courseName" form:"courseName" gorm:"-"`
......
...@@ -81,6 +81,8 @@ func (courseListService *CourseListService)GetCourseListInfoList(info courseReq. ...@@ -81,6 +81,8 @@ func (courseListService *CourseListService)GetCourseListInfoList(info courseReq.
err = global.GVA_DB.Model(&course.CourseSignup{}).Where("uid = ? and cid = ?",cu.ID,v.ID).First(&cs).Error err = global.GVA_DB.Model(&course.CourseSignup{}).Where("uid = ? and cid = ?",cu.ID,v.ID).First(&cs).Error
if err != nil && err != gorm.ErrRecordNotFound{ if err != nil && err != gorm.ErrRecordNotFound{
return return
} else if err != nil && err == gorm.ErrRecordNotFound {
continue
} }
if err == nil && *cs.IsPass{ if err == nil && *cs.IsPass{
v.IsSign = true v.IsSign = true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment