Browse Source

fix:bug

dev
Tooooommy 4 years ago
parent
commit
ba51b50201
  1. 13
      controllers/client/order_entry.go
  2. 2
      controllers/client/wx.go

13
controllers/client/order_entry.go

@ -22,6 +22,7 @@ func (t *OrderEntryCtl) List() {
_type := t.GetAccountType()
uid := t.GetAccountId()
activityId := t.MustGetInt("activity_id")
areaId := 0
if _type == define.TYPE_ENTRYPEOPLE {
entryPerson := models.OrderEntryPerson{}
@ -33,7 +34,17 @@ func (t *OrderEntryCtl) List() {
areaId = t.MustGetInt("area_id")
}
goods, err := models.GetGoodsByActivityId(activityId, areaId)
area := &models.AreaStore{}
exist, err := models.Get(area, areaId)
t.CheckErr(err)
t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "地区不存在")
if area.IsMainArea != 1 && area.AreaGoodsRuleSwitch != 1 {
exist, err = area.GetMainAreaById(activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_AREASTORE_NOT_EXIST, "地区不存在")
}
goods, err := models.GetGoodsByActivityId(activityId, area.Id)
t.CheckErr(err)
if _type == define.TYPE_USER {
for index := range goods {

2
controllers/client/wx.go

@ -10,7 +10,7 @@ import (
)
type WxCtl struct {
controllers.AuthorCtl
controllers.BaseCtl
}
const SignUrl = "jsapi_ticket=%s&noncestr=%s&timestamp=%d&url=%s"

Loading…
Cancel
Save