Browse Source

fix:bug

token_replace
黄梓健 4 years ago
parent
commit
9981ec119e
  1. 4
      controllers/client/order_entry.go
  2. 8
      utils/utils_test.go

4
controllers/client/order_entry.go

@ -325,7 +325,9 @@ func (t *OrderEntryCtl) ManualOrder() {
}
ms := make([]map[string]int, 0)
err = s.Table(&models.CustomerOrderSub{}).Select("goods_id, sum(goods_num) as goods_num").
err = s.Table(&models.CustomerOrderSub{}).Alias("s").Select("s.goods_id, (COALESCE sum(goods_num), 0) as goods_num").
Join("left", (&models.CustomerOrder{}).Alias("o"), "o.id=s.order_id").
Where("o.activity_id=? and o.rehearsal_id=? and o.arch_id=?", activity.Id, activity.RehearsalId, activity.ArchId).
In("goods_id", goodIds).GroupBy("goods_id").Find(&ms)
if err != nil {
s.Rollback()

8
utils/utils_test.go

@ -80,7 +80,7 @@ func TestCountDownFormat(t *testing.T) {
}
func login() string {
loginUrl := "https://api.ouxuanhudong.com/PcClient/Client/UserCtl/entryLogin?activity_id=410&account=18926327519&password=123456"
loginUrl := "https://api.ouxuanhudong.com/PcClient/Client/UserCtl/entryLogin?activity_id=411&account=SA45005&password=aodi666"
resp, _ := HttpRequest.NewRequest().Get(loginUrl)
var body = make(map[string]interface{}, 0)
resp.Json(&body)
@ -99,9 +99,9 @@ var incr = new(atomic.Int32)
func order(token string) {
orderUrl := "https://api.ouxuanhudong.com/PcClient/Client/OrderEntryCtl/manualOrder"
resp, _ := HttpRequest.NewRequest().Post(orderUrl, map[string]interface{}{
"name": "1222",
"phone": "22222222",
"goods": `[{"good_id":92,"good_num":1}]`,
"name": RandomStr(4),
"phone": RandomInt(11),
"goods": `[{"good_id":96,"good_num":1}]`,
"token": token,
})
var data = make(map[string]interface{})

Loading…
Cancel
Save