From c64e5e014310a57d46c0850fc8bcddeba0502586 Mon Sep 17 00:00:00 2001 From: tommy <3405129587@qq.com> Date: Mon, 3 Aug 2020 18:35:04 +0800 Subject: [PATCH] fix:bug --- controllers/pc/order_draw.go | 1 + models/customer_order.go | 4 ++-- models/order_draw_record.go | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/controllers/pc/order_draw.go b/controllers/pc/order_draw.go index 679278b..8b28287 100644 --- a/controllers/pc/order_draw.go +++ b/controllers/pc/order_draw.go @@ -399,6 +399,7 @@ func (t *OrderDrawCtl) Draw() { record.CustomerOrderId = o.BuyerId record.OrderDrawRuleLadderId = ladder.Id record.PrizeName = ladder.PrizeName + record.OrderEntryPersonName = o.OrderEntryPersonName record.AreaId = area.Id record.AreaName = area.Name _, err = models.Add(&record) diff --git a/models/customer_order.go b/models/customer_order.go index 364ec52..61739a8 100644 --- a/models/customer_order.go +++ b/models/customer_order.go @@ -98,8 +98,8 @@ func (t *CustomerOrder) CountCustomerOrder(activityId, rehearsalId, archId inter return buyerCount, err } -func (t *CustomerOrder) SumCustomerOrder(activityId, rehearsalId, archId interface{}, limit int) ([]map[string]interface{}, error) { - res := make([]map[string]interface{}, 0) +func (t *CustomerOrder) SumCustomerOrder(activityId, rehearsalId, archId interface{}, limit int) ([]map[string]string, error) { + res := make([]map[string]string, 0) err := core.GetXormAuto().Table(t).Select("order_entry_person_id, order_entry_person_name, SUM(goods_num) as num"). NoAutoCondition().Where("is_delete=0 and activity_id=? and rehearsal_id=? and arch_id=?", activityId, rehearsalId, archId).Limit(limit).Desc("num").Find(&res) diff --git a/models/order_draw_record.go b/models/order_draw_record.go index 5b098e7..57fdad9 100644 --- a/models/order_draw_record.go +++ b/models/order_draw_record.go @@ -21,6 +21,7 @@ type OrderDrawRecord struct { ArchId int `json:"arch_id" xorm:"not null default 0 comment('归档id') INT(11)"` User *User `json:"user" xorm:"-"` PrizeName string `json:"prize_name" xorm:"not null comment('奖品名字')"` + OrderEntryPersonName string `json:"order_entry_person_name" xorm:"not null default 0 comment('录入人员') VARCHAR(128)"` AreaId int `json:"area_id" xorm:"not null default(0) comment('地区id') BIGINT(20)"` AreaName string `json:"area_name" xorm:"not null default('') comment('地区id')"` IsDelete bool `json:"-" xorm:"default(0)"`