|
@ -13,6 +13,18 @@ type GoodCtl struct { |
|
|
controllers.AuthorCtl |
|
|
controllers.AuthorCtl |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (t *GoodCtl) GoodOption() { |
|
|
|
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
|
|
|
//areaId := t.MustGetInt64("area_id")
|
|
|
|
|
|
|
|
|
|
|
|
option := new(models.CustomerOrderOption) |
|
|
|
|
|
exist, err := option.GetByActivityId(activityId) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "订单活动不存在") |
|
|
|
|
|
|
|
|
|
|
|
t.JSON(option) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 商品列表
|
|
|
// 商品列表
|
|
|
func (t *GoodCtl) ListGood() { |
|
|
func (t *GoodCtl) ListGood() { |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
activityId := t.MustGetInt64("activity_id") |
|
@ -22,18 +34,11 @@ func (t *GoodCtl) ListGood() { |
|
|
exist, err := option.GetByActivityId(activityId) |
|
|
exist, err := option.GetByActivityId(activityId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "订单活动不存在") |
|
|
t.Assert(exist, code.MSG_DATA_NOT_EXIST, "订单活动不存在") |
|
|
//if option.Status == 0 {
|
|
|
|
|
|
// t.ERROR("订单活动尚未开启", code.MSG_ORDER_RULE_NOT_EXIST)
|
|
|
|
|
|
// return
|
|
|
|
|
|
//} else {
|
|
|
|
|
|
|
|
|
|
|
|
goods, err := models.GetGoodsByActivityId(activityId, areaId) |
|
|
goods, err := models.GetGoodsByActivityId(activityId, areaId) |
|
|
for index := range goods { |
|
|
|
|
|
goods[index].GoodType = option.PostFeeType |
|
|
|
|
|
goods[index].Postage = option.PostFee |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
t.JSON(goods) |
|
|
t.JSON(goods) |
|
|
//}
|
|
|
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|