diff --git a/app/custom/svc/svc_order.go b/app/custom/svc/svc_order.go index ccb3310..f897f6f 100644 --- a/app/custom/svc/svc_order.go +++ b/app/custom/svc/svc_order.go @@ -139,7 +139,7 @@ func TaskQrcodeSubmit(c *gin.Context) { e.OutErr(c, 400, e.NewErr(400, "二维码已失效")) return } - topUid := TopUid(c) + topUid := TopUidBySubmit(c, data.Uid) if topUid != data.FormUid { e.OutErr(c, 400, e.NewErr(400, "二维码已失效")) diff --git a/app/custom/svc/svc_task_list.go b/app/custom/svc/svc_task_list.go index 13a3b90..8d0d89a 100644 --- a/app/custom/svc/svc_task_list.go +++ b/app/custom/svc/svc_task_list.go @@ -290,6 +290,19 @@ func TopUid(c *gin.Context) int { } 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 { topUid := TopUid(c) var m = make([]md.CampTaskListGroup, 0)