huangjiajun 1 week ago
parent
commit
0efcbb866e
2 changed files with 14 additions and 1 deletions
  1. +1
    -1
      app/custom/svc/svc_order.go
  2. +13
    -0
      app/custom/svc/svc_task_list.go

+ 1
- 1
app/custom/svc/svc_order.go View File

@@ -139,7 +139,7 @@ func TaskQrcodeSubmit(c *gin.Context) {
e.OutErr(c, 400, e.NewErr(400, "二维码已失效")) e.OutErr(c, 400, e.NewErr(400, "二维码已失效"))
return return
} }
topUid := TopUid(c)
topUid := TopUidBySubmit(c, data.Uid)


if topUid != data.FormUid { if topUid != data.FormUid {
e.OutErr(c, 400, e.NewErr(400, "二维码已失效")) e.OutErr(c, 400, e.NewErr(400, "二维码已失效"))


+ 13
- 0
app/custom/svc/svc_task_list.go View File

@@ -290,6 +290,19 @@ func TopUid(c *gin.Context) int {
} }
return topUid return topUid
} }
func TopUidBySubmit(c *gin.Context, uid int) int {
topUid := 0
sql := `select ur.parent_uid from user_relate ur
left join user u on u.uid=ur.parent_uid
where ur.uid=%d and u.level in(2,3) order by ur.level limit 1
`
sql = fmt.Sprintf(sql, uid)
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql)
for _, v := range nativeString {
topUid = utils.StrToInt(v["parent_uid"])
}
return topUid
}
func CommTask(c *gin.Context, arg map[string]string) *[]md.CampTaskListGroup { func CommTask(c *gin.Context, arg map[string]string) *[]md.CampTaskListGroup {
topUid := TopUid(c) topUid := TopUid(c)
var m = make([]md.CampTaskListGroup, 0) var m = make([]md.CampTaskListGroup, 0)


Loading…
Cancel
Save