|
@ -17,18 +17,21 @@ type OrderEntryCtl struct { |
|
|
|
|
|
|
|
|
// 用户查看所有商品
|
|
|
// 用户查看所有商品
|
|
|
func (t *OrderEntryCtl) List() { |
|
|
func (t *OrderEntryCtl) List() { |
|
|
uid := t.MustGetUID() |
|
|
_type := t.GetAccountType() |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
areaId := t.MustGetInt64("area_id") |
|
|
areaId := t.MustGetInt64("area_id") |
|
|
|
|
|
|
|
|
goods, err := models.GetGoodsByActivityId(activityId, areaId) |
|
|
goods, err := models.GetGoodsByActivityId(activityId, areaId) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
|
for index := range goods { |
|
|
if _type == define.TYPE_H5USER { |
|
|
url := fmt.Sprintf("%s/PcClient/Client/OrderEntryCtl/order?"+ |
|
|
uid := t.GetAccountId() |
|
|
"user_id=%d&activity_id=%d&good_id=%d", define.HOST, uid, activityId, goods[index].Id) |
|
|
for index := range goods { |
|
|
qrcode, err := utils.Qrcode2Base64(url) |
|
|
url := fmt.Sprintf("%s/PcClient/Client/OrderEntryCtl/order?"+ |
|
|
t.CheckErr(err) |
|
|
"user_id=%d&activity_id=%d&good_id=%d", define.HOST, uid, activityId, goods[index].Id) |
|
|
goods[index].Qrcode = qrcode |
|
|
qrcode, err := utils.Qrcode2Base64(url) |
|
|
|
|
|
t.CheckErr(err) |
|
|
|
|
|
goods[index].Qrcode = qrcode |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
t.JSON(map[string]interface{}{ |
|
|
t.JSON(map[string]interface{}{ |
|
@ -41,7 +44,7 @@ func (t *OrderEntryCtl) List() { |
|
|
func (t *OrderEntryCtl) Order() { |
|
|
func (t *OrderEntryCtl) Order() { |
|
|
userId := t.MustGetInt64("user_id") |
|
|
userId := t.MustGetInt64("user_id") |
|
|
goodId := t.MustGetInt64("good_id") |
|
|
goodId := t.MustGetInt64("good_id") |
|
|
entryId := t.MustGetUID() |
|
|
entryId := t.GetAccountId() |
|
|
|
|
|
|
|
|
entryPerson := models.OrderEntryPerson{} |
|
|
entryPerson := models.OrderEntryPerson{} |
|
|
exist, err := models.Get(&entryPerson, entryId) |
|
|
exist, err := models.Get(&entryPerson, entryId) |
|
@ -196,7 +199,7 @@ type ManualOrderParam struct { |
|
|
|
|
|
|
|
|
// 手动下单
|
|
|
// 手动下单
|
|
|
func (t *OrderEntryCtl) ManualOrder() { |
|
|
func (t *OrderEntryCtl) ManualOrder() { |
|
|
entryId := t.MustGetUID() // 录入人员id
|
|
|
entryId := t.GetAccountId() // 录入人员id
|
|
|
param := &ManualOrderParam{} |
|
|
param := &ManualOrderParam{} |
|
|
err := t.Bind(param) |
|
|
err := t.Bind(param) |
|
|
t.CheckErr(err) |
|
|
t.CheckErr(err) |
|
@ -407,7 +410,7 @@ type OrderListResult struct { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (t *OrderEntryCtl) EntryOrders() { |
|
|
func (t *OrderEntryCtl) EntryOrders() { |
|
|
uid := t.MustGetUID() |
|
|
uid := t.GetAccountId() |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
|
|
|
|
|
|
entry := new(models.OrderEntryPerson) |
|
|
entry := new(models.OrderEntryPerson) |
|
@ -456,7 +459,7 @@ type UserOrdersResult struct { |
|
|
|
|
|
|
|
|
// 用户查看订单列表
|
|
|
// 用户查看订单列表
|
|
|
func (t *OrderEntryCtl) UserOrders() { |
|
|
func (t *OrderEntryCtl) UserOrders() { |
|
|
uid := t.MustGetUID() |
|
|
uid := t.GetAccountId() |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
activityId := t.MustGetInt64("activity_id") |
|
|
|
|
|
|
|
|
activity := new(models.Activity) |
|
|
activity := new(models.Activity) |
|
|
xxxxxxxxxx