Commit 8cc09fe0 authored by szh's avatar szh

update

parent a8340044
...@@ -3707,6 +3707,11 @@ var doc = `{ ...@@ -3707,6 +3707,11 @@ var doc = `{
}, },
{ {
"type": "boolean", "type": "boolean",
"name": "isPass",
"in": "query"
},
{
"type": "boolean",
"name": "isShow", "name": "isShow",
"in": "query" "in": "query"
}, },
...@@ -3784,6 +3789,11 @@ var doc = `{ ...@@ -3784,6 +3789,11 @@ var doc = `{
}, },
{ {
"type": "boolean", "type": "boolean",
"name": "isPass",
"in": "query"
},
{
"type": "boolean",
"name": "isShow", "name": "isShow",
"in": "query" "in": "query"
}, },
...@@ -3861,6 +3871,11 @@ var doc = `{ ...@@ -3861,6 +3871,11 @@ var doc = `{
}, },
{ {
"type": "boolean", "type": "boolean",
"name": "isPass",
"in": "query"
},
{
"type": "boolean",
"name": "isShow", "name": "isShow",
"in": "query" "in": "query"
}, },
...@@ -19212,6 +19227,9 @@ var doc = `{ ...@@ -19212,6 +19227,9 @@ var doc = `{
"description": "主键ID", "description": "主键ID",
"type": "integer" "type": "integer"
}, },
"isPass": {
"type": "boolean"
},
"isShow": { "isShow": {
"type": "boolean" "type": "boolean"
}, },
......
...@@ -3691,6 +3691,11 @@ ...@@ -3691,6 +3691,11 @@
}, },
{ {
"type": "boolean", "type": "boolean",
"name": "isPass",
"in": "query"
},
{
"type": "boolean",
"name": "isShow", "name": "isShow",
"in": "query" "in": "query"
}, },
...@@ -3768,6 +3773,11 @@ ...@@ -3768,6 +3773,11 @@
}, },
{ {
"type": "boolean", "type": "boolean",
"name": "isPass",
"in": "query"
},
{
"type": "boolean",
"name": "isShow", "name": "isShow",
"in": "query" "in": "query"
}, },
...@@ -3845,6 +3855,11 @@ ...@@ -3845,6 +3855,11 @@
}, },
{ {
"type": "boolean", "type": "boolean",
"name": "isPass",
"in": "query"
},
{
"type": "boolean",
"name": "isShow", "name": "isShow",
"in": "query" "in": "query"
}, },
...@@ -19196,6 +19211,9 @@ ...@@ -19196,6 +19211,9 @@
"description": "主键ID", "description": "主键ID",
"type": "integer" "type": "integer"
}, },
"isPass": {
"type": "boolean"
},
"isShow": { "isShow": {
"type": "boolean" "type": "boolean"
}, },
......
...@@ -877,6 +877,8 @@ definitions: ...@@ -877,6 +877,8 @@ definitions:
id: id:
description: 主键ID description: 主键ID
type: integer type: integer
isPass:
type: boolean
isShow: isShow:
type: boolean type: boolean
isSign: isSign:
...@@ -4714,6 +4716,9 @@ paths: ...@@ -4714,6 +4716,9 @@ paths:
name: id name: id
type: integer type: integer
- in: query - in: query
name: isPass
type: boolean
- in: query
name: isShow name: isShow
type: boolean type: boolean
- in: query - in: query
...@@ -4761,6 +4766,9 @@ paths: ...@@ -4761,6 +4766,9 @@ paths:
name: id name: id
type: integer type: integer
- in: query - in: query
name: isPass
type: boolean
- in: query
name: isShow name: isShow
type: boolean type: boolean
- in: query - in: query
...@@ -4811,6 +4819,9 @@ paths: ...@@ -4811,6 +4819,9 @@ paths:
name: id name: id
type: integer type: integer
- in: query - in: query
name: isPass
type: boolean
- in: query
name: isShow name: isShow
type: boolean type: boolean
- in: query - in: query
......
...@@ -33,6 +33,6 @@ func (s *CourseActionUsersRouter) InitCourseActionUsersMetaMaskRouter(Router *gi ...@@ -33,6 +33,6 @@ func (s *CourseActionUsersRouter) InitCourseActionUsersMetaMaskRouter(Router *gi
var courseActionUsersApi = v1.ApiGroupApp.CourseApiGroup.CourseActionUsersApi var courseActionUsersApi = v1.ApiGroupApp.CourseApiGroup.CourseActionUsersApi
{ {
courseActionUsersRouter.POST("signAction", courseActionUsersApi.SignAction) // 新建CourseActionUsers courseActionUsersRouter.POST("signAction", courseActionUsersApi.SignAction) // 新建CourseActionUsers
courseActionUsersRouter.POST("myAction", courseActionUsersApi.GetMyAction) // 新建CourseActionUsers courseActionUsersRouter.GET("myAction", courseActionUsersApi.GetMyAction) // 新建CourseActionUsers
} }
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"courseSign/server/model/common/request" "courseSign/server/model/common/request"
"courseSign/server/model/course" "courseSign/server/model/course"
courseReq "courseSign/server/model/course/request" courseReq "courseSign/server/model/course/request"
"go.uber.org/zap"
"gorm.io/gorm" "gorm.io/gorm"
) )
...@@ -78,21 +79,20 @@ func (courseListService *CourseListService)GetCourseListInfoList(info courseReq. ...@@ -78,21 +79,20 @@ func (courseListService *CourseListService)GetCourseListInfoList(info courseReq.
} }
for _, v := range courseLists { for _, v := range courseLists {
var cs course.CourseSignup var cs course.CourseSignup
err = global.GVA_DB.Debug().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 { } else if err != nil && err == gorm.ErrRecordNotFound {
err = nil err = nil
continue continue
} }
if err == nil && *cs.IsPass{ if err == nil && cs.ID >0 {
v.IsSign = true v.IsSign = true
}
if *cs.IsPass {
v.IsPass = true v.IsPass = true
} else if err == nil && !*cs.IsPass {
v.IsSign = true
v.IsPass = false
} }
global.GVA_LOG.Info("info",zap.Any("detail",v))
} }
} }
return courseLists, total, err return courseLists, total, err
......
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