Browse Source

fix:bug

token_replace
黄梓健 4 years ago
parent
commit
db7caf3f3d
  1. 2
      controllers/client/order_entry.go
  2. 13
      controllers/pc/order_draw.go

2
controllers/client/order_entry.go

@ -364,6 +364,8 @@ func (t *OrderEntryCtl) ManualOrder() {
order.Receiver = param.Name
order.Phone = param.Phone
order.GoodsNum = goodNum
order.GoodsId = subs[0].GoodsId
order.GoodsName = subs[0].GoodName
order.OutTradeNo = utils.RandomStr(32)
order.OrderNo = fmt.Sprint(define.DefaultOrderNo + int(count))
order.Status = 1

13
controllers/pc/order_draw.go

@ -548,11 +548,14 @@ func (t *OrderDrawCtl) Orders() {
} else {
count, err := (&models.CustomerOrder{}).CountCustomerOrder(activity.Id, activity.RehearsalId, activity.ArchId, 1)
orders := make([]*OrdersResult, 0)
err = core.GetXormAuto().Table(&models.CustomerOrder{}).Alias("o").
Select("o.area_name, o.goods_name, o.buyer_id as user_id, u.nickname, l.extra_data as extra_data, o.created_at").
Distinct("o.id").Join("LEFT", (&models.InvitationLetter{}).Alias("l"),
"o.buyer_id=l.user_id and o.activity_id=l.activity_id and l.arch_id=o.arch_id").
Join("LEFT", (&models.User{}).Alias("u"), "u.id=o.buyer_id").
err = core.GetXormAuto().Table(&models.CustomerOrder{}).Alias("o").Select("o.id as id, "+
" o.area_name, o.order_entry_person_name as entry_person_name, o.buyer_id as user_id, "+
" o.receiver as nickname, o.phone as phone, o.address as address, o.created_at").
//Select("o.area_name, o.goods_name, o.buyer_id as user_id, u.nickname, l.extra_data as extra_data, o.created_at").
//Distinct("o.id").Join("LEFT", (&models.InvitationLetter{}).Alias("l"),
//"o.buyer_id=l.user_id and o.activity_id=l.activity_id "+
// "and l.rehearsal_id= o.rehearsal_id and l.arch_id=o.arch_id").
//Join("LEFT", (&models.User{}).Alias("u"), "u.id=o.buyer_id").
Where("o.is_delete=0 and o.activity_id=? and o.rehearsal_id=? and o.arch_id=?",
activityId, activity.RehearsalId, activity.ArchId).
Asc("o.created_at").Find(&orders)

Loading…
Cancel
Save