|
|
@ -104,10 +104,19 @@ func (t *TugOfWarCtl) Team() { |
|
|
|
baheId := t.MustGetInt64("bahe_activity_id") |
|
|
|
customerId := t.MustGetUID() |
|
|
|
|
|
|
|
customer := new(models.Customer) |
|
|
|
exist, err := models.Get(customer, customerId) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_CUSTOMER_NOT_EXIST, "客户不存在") |
|
|
|
|
|
|
|
bahe := new(models.TugOfWar) |
|
|
|
exist, err := models.Get(bahe, baheId) |
|
|
|
exist, err = models.Get(bahe, baheId) |
|
|
|
t.CheckErr(err) |
|
|
|
t.Assert(exist, code.MSG_TUGWAR_NOT_EXIST, "拔河不存在") |
|
|
|
if bahe.Status == define.StatusNotBegin { |
|
|
|
t.ERROR("拔河尚未开始", code.MSG_TUGWAR_NOT_EXIST) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
activity := new(models.Activity) |
|
|
|
exist, err = models.Get(activity, bahe.ActivityId) |
|
|
@ -127,10 +136,14 @@ func (t *TugOfWarCtl) Team() { |
|
|
|
// 队伍颜色
|
|
|
|
qrcode := "" |
|
|
|
// 二维码
|
|
|
|
link := define.H5TugOfWar |
|
|
|
if customer.IsSpecial == 1 { |
|
|
|
link = define.H5TugOfWar2020 |
|
|
|
} |
|
|
|
if bahe.Model != "随机分配模式" { |
|
|
|
// 非随机模式,自选队伍
|
|
|
|
for index := range teams { |
|
|
|
qrcode, err = utils.GenH5Qrcode(define.H5TugOfWar, map[string]interface{}{ |
|
|
|
qrcode, err = utils.GenH5Qrcode(link, map[string]interface{}{ |
|
|
|
"area_id": area.Id, |
|
|
|
"activity_id": bahe.ActivityId, |
|
|
|
"customer_id": customerId, |
|
|
@ -142,7 +155,7 @@ func (t *TugOfWarCtl) Team() { |
|
|
|
teams[index].Qrcode = qrcode |
|
|
|
} |
|
|
|
} else { |
|
|
|
qrcode, err = utils.GenH5Qrcode(define.H5TugOfWar, map[string]interface{}{ |
|
|
|
qrcode, err = utils.GenH5Qrcode(link, map[string]interface{}{ |
|
|
|
"area_id": area.Id, |
|
|
|
"activity_id": bahe.ActivityId, |
|
|
|
"customer_id": customerId, |
|
|
|