huangjiajun 1 week geleden
bovenliggende
commit
273a06a4bf
3 gewijzigde bestanden met toevoegingen van 12 en 23 verwijderingen
  1. +3
    -2
      app/custom/svc/svc_my_task.go
  2. +1
    -12
      app/custom/svc/svc_order.go
  3. +8
    -9
      app/custom/svc/svc_task_list.go

+ 3
- 2
app/custom/svc/svc_my_task.go Bestand weergeven

@@ -45,14 +45,15 @@ func TaskIncomeTaskList(c *gin.Context) {
return
}
user := svc.GetUser(c)
topUid := TopUid(c)
sql := `
SELECT ctls.*,ct.id as op_id FROM camp_task_operator_task ct
LEFT JOIN camp_task_list ctls on ctls.id=ct.task_id
where ctls.first_cid in(
SELECT ctl.first_cid FROM camp_task_user_promotion_qrcode ctupo
LEFT JOIN camp_task_list ctl on ctl.id=ctupo.task_id
WHERE ctupo.uid=%d GROUP BY ctupo.task_id ) and ctls.up_down_state=1 and ctls.num>0 order by ctls.extend_num desc,ctls.id desc %s`
sql = fmt.Sprintf(sql, user.Info.Uid, "limit "+utils.IntToStr((utils.StrToInt(args["p"])-1)*10)+",10")
WHERE ctupo.uid=%d GROUP BY ctupo.task_id ) and ct.uid=%d and ctls.up_down_state=1 and ctls.num>0 group by ctls.id order by ctls.extend_num desc,ctls.id desc %s`
sql = fmt.Sprintf(sql, user.Info.Uid, topUid, "limit "+utils.IntToStr((utils.StrToInt(args["p"])-1)*10)+",10")
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql)
list := make([]map[string]string, 0)
for _, v := range nativeString {


+ 1
- 12
app/custom/svc/svc_order.go Bestand weergeven

@@ -138,18 +138,7 @@ func TaskQrcodeSubmit(c *gin.Context) {
e.OutErr(c, 400, e.NewErr(400, "二维码已失效"))
return
}
topUid := 0
if user != nil {
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, user.Uid)
nativeString, _ := db.QueryNativeString(svc.MasterDb(c), sql)
for _, v := range nativeString {
topUid = utils.StrToInt(v["parent_uid"])
}
}
topUid := TopUid(c)

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


+ 8
- 9
app/custom/svc/svc_task_list.go Bestand weergeven

@@ -145,8 +145,6 @@ func TaskDetail(c *gin.Context) {
priceList := make([]map[string]string, 0)
count, _ := svc.MasterDb(c).Where("task_id=?", CampTaskOperatorTask.TaskId).Count(&models.CampTaskNotice{})
noticeNum := utils.Int64ToStr(count)
labelStr := ""

tmp := map[string]interface{}{
"id": utils.IntToStr(CampTaskOperatorTask.Id),
"name": hotTaskList.Name,
@@ -155,7 +153,7 @@ func TaskDetail(c *gin.Context) {
"icon": svc.ImageFormat(c, hotTaskList.Logo),
"timer": hotTaskList.StartTime.Format("2006-01-02") + "至" + hotTaskList.EndTime.Format("2006-01-02"),
"detail_info": DetailInfo,
"label": labelStr,
"label": label,
"is_can_buy": "1",
"buy_tip_str": "",
"reward_list": reward,
@@ -172,15 +170,12 @@ func TaskDetail(c *gin.Context) {
if taskDetail != nil {
json.Unmarshal([]byte(taskDetail.DetailInfo), &DetailInfo)
tmp["detail_info"] = DetailInfo
tmp["detail_info"] = taskDetail.VideoCourse
tmp["video_course"] = taskDetail.VideoCourse
tmp["notice"] = taskDetail.Notice
tmp["instructions"] = taskDetail.Instructions
}
json.Unmarshal([]byte(hotTaskList.Label), &label)
if len(label) > 0 {
labelStr = strings.Join(label, " ")
}
tmp["label"] = labelStr
tmp["label"] = label
user, _ := svc.GetDefaultUser(c, c.GetHeader("Authorization"))
_, firstPrice, secondPrice, thirdPrice, _ := CommPrice(c, hotTaskList.Price)

@@ -279,7 +274,7 @@ func TaskDetailNoticeCate(c *gin.Context) {
e.OutSuc(c, cateType, nil)
return
}
func CommTask(c *gin.Context, arg map[string]string) *[]md.CampTaskListGroup {
func TopUid(c *gin.Context) int {
user, _ := svc.GetDefaultUser(c, c.GetHeader("Authorization"))
topUid := 0
if user != nil {
@@ -293,6 +288,10 @@ func CommTask(c *gin.Context, arg map[string]string) *[]md.CampTaskListGroup {
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)
sess := svc.MasterDb(c).Table("camp_task_operator_task").Where("camp_task_operator_task.uid=?", topUid)
sess.Join("LEFT", "camp_task_list", "camp_task_operator_task.task_id = camp_task_list.id")


Laden…
Annuleren
Opslaan