Browse Source

fix:bug

token_replace
黄梓健 5 years ago
parent
commit
c64e5e0143
  1. 1
      controllers/pc/order_draw.go
  2. 4
      models/customer_order.go
  3. 1
      models/order_draw_record.go

1
controllers/pc/order_draw.go

@ -399,6 +399,7 @@ func (t *OrderDrawCtl) Draw() {
record.CustomerOrderId = o.BuyerId record.CustomerOrderId = o.BuyerId
record.OrderDrawRuleLadderId = ladder.Id record.OrderDrawRuleLadderId = ladder.Id
record.PrizeName = ladder.PrizeName record.PrizeName = ladder.PrizeName
record.OrderEntryPersonName = o.OrderEntryPersonName
record.AreaId = area.Id record.AreaId = area.Id
record.AreaName = area.Name record.AreaName = area.Name
_, err = models.Add(&record) _, err = models.Add(&record)

4
models/customer_order.go

@ -98,8 +98,8 @@ func (t *CustomerOrder) CountCustomerOrder(activityId, rehearsalId, archId inter
return buyerCount, err 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"). 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=?", NoAutoCondition().Where("is_delete=0 and activity_id=? and rehearsal_id=? and arch_id=?",
activityId, rehearsalId, archId).Limit(limit).Desc("num").Find(&res) activityId, rehearsalId, archId).Limit(limit).Desc("num").Find(&res)

1
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)"` ArchId int `json:"arch_id" xorm:"not null default 0 comment('归档id') INT(11)"`
User *User `json:"user" xorm:"-"` User *User `json:"user" xorm:"-"`
PrizeName string `json:"prize_name" xorm:"not null comment('奖品名字')"` 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)"` 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')"` AreaName string `json:"area_name" xorm:"not null default('') comment('地区id')"`
IsDelete bool `json:"-" xorm:"default(0)"` IsDelete bool `json:"-" xorm:"default(0)"`

Loading…
Cancel
Save