作者 陈志颖

fix:年榜时间重合

... ... @@ -483,3 +483,182 @@
BodyData:
2020/11/22 17:34:08.225 [D] [server.go:2843] <====Send RequestId:POST./cash-pool/activity/exchange-list/import.1606037648026939000 BodyData:{"code":0,"data":{"fail":null,"successCount":1},"msg":"ok"}
2020/11/22 17:34:08.225 [D] [server.go:1925] | 127.0.0.1| 200 | 198.53039ms| match| POST  /cash-pool/activity/exchange-list/import r:/cash-pool/activity/exchange-list/import
2020/11/22 18:17:10.614 [I] [???:0] http server Running on http://:8082
2020/11/22 18:17:14.084 [D] [server.go:2843] ====>Recv User:<nil> RequestId:GET./cash-pool/activity/?companyId=311&offset=0&limit=20&isEnd=true.1606040234084726000
Auth=
BodyData:{}
2020/11/22 18:17:14.261 [D] [server.go:2843] <====Send RequestId:GET./cash-pool/activity/?companyId=311&offset=0&limit=20&isEnd=true.1606040234084726000 BodyData:{"code":501,"msg":"内部服务出错:ERROR #42703 column exchange_cash_activity.countdown does not exist"}
2020/11/22 18:17:14.263 [D] [server.go:1925] | 127.0.0.1| 200 | 177.978134ms| match| GET  /cash-pool/activity/ r:/cash-pool/activity/
2020/11/22 19:12:19.790 [I] [???:0] http server Running on http://:8082
2020/11/22 19:14:49.683 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./statistics/person-su-money.1606043689683352000
Auth=
BodyData:{
"uid": 3248817613892608
}
2020/11/22 19:14:50.198 [D] [server.go:2843] <====Send RequestId:POST./statistics/person-su-money.1606043689683352000 BodyData:{"code":0,"data":{"currentSuMoney":16757.219999999998,"incomeSuMoney":15357.22,"incomeSuMoneyOfYesterday":0},"msg":"ok"}
2020/11/22 19:14:50.198 [D] [server.go:1925] | 127.0.0.1| 200 | 515.560355ms| match| POST  /statistics/person-su-money r:/statistics/person-su-money
2020/11/22 19:36:08.871 [I] [???:0] http server Running on http://:8082
2020/11/22 19:36:29.733 [D] [server.go:2843] ====>Recv User:<nil> RequestId:GET./list-interval/?companyId=381&offset=0&limit=20.1606044989733527000
Auth=
BodyData:{}
2020/11/22 19:36:29.832 [D] [server.go:2843] <====Send RequestId:GET./list-interval/?companyId=381&offset=0&limit=20.1606044989733527000 BodyData:{"code":0,"data":{"count":1,"listIntervals":[{"listIntervalId":7,"companyId":381,"intervalStartTime":"2020-11-16T00:00:00+08:00","intervalEndTime":"2020-11-17T00:00:00+08:00"}]},"msg":"ok"}
2020/11/22 19:36:29.832 [D] [server.go:1925] | 127.0.0.1| 200 | 98.964301ms| match| GET  /list-interval/ r:/list-interval/
2020/11/22 19:38:04.075 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/7.1606045084074929000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-10T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-16T12:01:54.851528+08:00"
}
2020/11/22 19:38:04.138 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/7.1606045084074929000 BodyData:{"code":0,"data":{"listIntervalId":7,"companyId":381,"intervalStartTime":"2020-11-10T12:01:54.851528+08:00","intervalEndTime":"2020-11-16T12:01:54.851528+08:00"},"msg":"ok"}
2020/11/22 19:38:04.138 [D] [server.go:1925] | 127.0.0.1| 200 | 63.625988ms| match| PUT  /list-interval/7 r:/list-interval/:listId
2020/11/22 19:38:30.814 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./list-interval/.1606045110814442000
Auth=
BodyData:{
"companyId": 381,
"listIntervalStartTime": "2020-11-09T12:02:55.851528+08:00",
"listIntervalEndTime": "2020-12-16T12:01:54.851528+08:00"
}
2020/11/22 19:38:30.819 [D] [server.go:2843] <====Send RequestId:POST./list-interval/.1606045110814442000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:38:30.819 [D] [server.go:1925] | 127.0.0.1| 200 | 6.050307ms| match| POST  /list-interval/ r:/list-interval/
2020/11/22 19:38:36.510 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./list-interval/.1606045116510866000
Auth=
BodyData:{
"companyId": 381,
"listIntervalStartTime": "2020-11-10T12:02:55.851528+08:00",
"listIntervalEndTime": "2020-12-16T12:01:54.851528+08:00"
}
2020/11/22 19:38:36.541 [D] [server.go:2843] <====Send RequestId:POST./list-interval/.1606045116510866000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:38:36.541 [D] [server.go:1925] | 127.0.0.1| 200 | 30.741996ms| match| POST  /list-interval/ r:/list-interval/
2020/11/22 19:38:40.976 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./list-interval/.1606045120976236000
Auth=
BodyData:{
"companyId": 381,
"listIntervalStartTime": "2020-11-11T12:02:55.851528+08:00",
"listIntervalEndTime": "2020-12-16T12:01:54.851528+08:00"
}
2020/11/22 19:38:40.995 [D] [server.go:2843] <====Send RequestId:POST./list-interval/.1606045120976236000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:38:40.996 [D] [server.go:1925] | 127.0.0.1| 200 | 19.840269ms| match| POST  /list-interval/ r:/list-interval/
2020/11/22 19:38:47.358 [D] [server.go:2843] ====>Recv User:<nil> RequestId:GET./list-interval/?companyId=381&offset=0&limit=20.1606045127358409000
Auth=
BodyData:{}
2020/11/22 19:38:47.370 [D] [server.go:2843] <====Send RequestId:GET./list-interval/?companyId=381&offset=0&limit=20.1606045127358409000 BodyData:{"code":0,"data":{"count":1,"listIntervals":[{"listIntervalId":7,"companyId":381,"intervalStartTime":"2020-11-10T12:01:54.851528+08:00","intervalEndTime":"2020-11-16T12:01:54.851528+08:00"}]},"msg":"ok"}
2020/11/22 19:38:47.370 [D] [server.go:1925] | 127.0.0.1| 200 | 11.991998ms| match| GET  /list-interval/ r:/list-interval/
2020/11/22 19:39:00.524 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./list-interval/.1606045140524533000
Auth=
BodyData:{
"companyId": 381,
"listIntervalStartTime": "2020-11-12T12:02:55.851528+08:00",
"listIntervalEndTime": "2020-12-16T12:01:54.851528+08:00"
}
2020/11/22 19:39:00.531 [D] [server.go:2843] <====Send RequestId:POST./list-interval/.1606045140524533000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:39:00.531 [D] [server.go:1925] | 127.0.0.1| 200 | 7.235681ms| match| POST  /list-interval/ r:/list-interval/
2020/11/22 19:39:03.901 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./list-interval/.1606045143901405000
Auth=
BodyData:{
"companyId": 381,
"listIntervalStartTime": "2020-11-13T12:02:55.851528+08:00",
"listIntervalEndTime": "2020-12-16T12:01:54.851528+08:00"
}
2020/11/22 19:39:03.908 [D] [server.go:2843] <====Send RequestId:POST./list-interval/.1606045143901405000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:39:03.908 [D] [server.go:1925] | 127.0.0.1| 200 | 7.322637ms| match| POST  /list-interval/ r:/list-interval/
2020/11/22 19:39:06.970 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./list-interval/.1606045146970949000
Auth=
BodyData:{
"companyId": 381,
"listIntervalStartTime": "2020-11-14T12:02:55.851528+08:00",
"listIntervalEndTime": "2020-12-16T12:01:54.851528+08:00"
}
2020/11/22 19:39:07.065 [D] [server.go:2843] <====Send RequestId:POST./list-interval/.1606045146970949000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:39:07.065 [D] [server.go:1925] | 127.0.0.1| 200 | 94.807223ms| match| POST  /list-interval/ r:/list-interval/
2020/11/22 19:39:10.726 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./list-interval/.1606045150726957000
Auth=
BodyData:{
"companyId": 381,
"listIntervalStartTime": "2020-11-15T12:02:55.851528+08:00",
"listIntervalEndTime": "2020-12-16T12:01:54.851528+08:00"
}
2020/11/22 19:39:10.740 [D] [server.go:2843] <====Send RequestId:POST./list-interval/.1606045150726957000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:39:10.740 [D] [server.go:1925] | 127.0.0.1| 200 | 13.756698ms| match| POST  /list-interval/ r:/list-interval/
2020/11/22 19:39:14.447 [D] [server.go:2843] ====>Recv User:<nil> RequestId:POST./list-interval/.1606045154447071000
Auth=
BodyData:{
"companyId": 381,
"listIntervalStartTime": "2020-11-16T12:02:55.851528+08:00",
"listIntervalEndTime": "2020-12-16T12:01:54.851528+08:00"
}
2020/11/22 19:39:14.706 [D] [server.go:2843] <====Send RequestId:POST./list-interval/.1606045154447071000 BodyData:{"code":0,"data":{"listIntervalId":20,"companyId":381,"intervalStartTime":"2020-11-16T12:02:55.851528+08:00","intervalEndTime":"2020-12-16T12:01:54.851528+08:00"},"msg":"ok"}
2020/11/22 19:39:14.706 [D] [server.go:1925] | 127.0.0.1| 200 | 259.405323ms| match| POST  /list-interval/ r:/list-interval/
2020/11/22 19:39:24.546 [D] [server.go:2843] ====>Recv User:<nil> RequestId:GET./list-interval/?companyId=381&offset=0&limit=20.1606045164546223000
Auth=
BodyData:{}
2020/11/22 19:39:24.551 [D] [server.go:2843] <====Send RequestId:GET./list-interval/?companyId=381&offset=0&limit=20.1606045164546223000 BodyData:{"code":0,"data":{"count":2,"listIntervals":[{"listIntervalId":20,"companyId":381,"intervalStartTime":"2020-11-16T12:02:55.851528+08:00","intervalEndTime":"2020-12-16T12:01:54.851528+08:00"},{"listIntervalId":7,"companyId":381,"intervalStartTime":"2020-11-10T12:01:54.851528+08:00","intervalEndTime":"2020-11-16T12:01:54.851528+08:00"}]},"msg":"ok"}
2020/11/22 19:39:24.551 [D] [server.go:1925] | 127.0.0.1| 200 | 5.530137ms| match| GET  /list-interval/ r:/list-interval/
2020/11/22 19:39:58.983 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/20.1606045198983054000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-10T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-16T12:01:54.851528+08:00"
}
2020/11/22 19:39:59.000 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/20.1606045198983054000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:39:59.027 [D] [server.go:1925] | 127.0.0.1| 200 | 44.73455ms| match| PUT  /list-interval/20 r:/list-interval/:listId
2020/11/22 19:40:01.694 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/20.1606045201694007000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-10T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-16T12:01:54.851528+08:00"
}
2020/11/22 19:40:01.698 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/20.1606045201694007000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:40:01.698 [D] [server.go:1925] | 127.0.0.1| 200 | 4.185461ms| match| PUT  /list-interval/20 r:/list-interval/:listId
2020/11/22 19:40:08.567 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/20.1606045208567467000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-10T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-20T12:01:54.851528+08:00"
}
2020/11/22 19:40:08.571 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/20.1606045208567467000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:40:08.571 [D] [server.go:1925] | 127.0.0.1| 200 | 4.336836ms| match| PUT  /list-interval/20 r:/list-interval/:listId
2020/11/22 19:40:13.378 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/20.1606045213378658000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-11T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-20T12:01:54.851528+08:00"
}
2020/11/22 19:40:13.415 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/20.1606045213378658000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:40:13.416 [D] [server.go:1925] | 127.0.0.1| 200 | 38.183747ms| match| PUT  /list-interval/20 r:/list-interval/:listId
2020/11/22 19:40:17.764 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/20.1606045217764641000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-14T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-20T12:01:54.851528+08:00"
}
2020/11/22 19:40:17.777 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/20.1606045217764641000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:40:17.801 [D] [server.go:1925] | 127.0.0.1| 200 | 36.762524ms| match| PUT  /list-interval/20 r:/list-interval/:listId
2020/11/22 19:40:21.083 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/20.1606045221083406000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-15T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-20T12:01:54.851528+08:00"
}
2020/11/22 19:40:21.171 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/20.1606045221083406000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:40:21.180 [D] [server.go:1925] | 127.0.0.1| 200 | 97.416213ms| match| PUT  /list-interval/20 r:/list-interval/:listId
2020/11/22 19:40:24.666 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/20.1606045224666853000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-16T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-20T12:01:54.851528+08:00"
}
2020/11/22 19:40:24.693 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/20.1606045224666853000 BodyData:{"code":501,"msg":"内部服务出错:年榜开始时间必须大于上一个年榜结束时间"}
2020/11/22 19:40:24.693 [D] [server.go:1925] | 127.0.0.1| 200 | 27.14888ms| match| PUT  /list-interval/20 r:/list-interval/:listId
2020/11/22 19:40:30.295 [D] [server.go:2843] ====>Recv User:<nil> RequestId:PUT./list-interval/20.1606045230295148000
Auth=
BodyData:{
"listIntervalStartTime": "2020-11-17T12:01:54.851528+08:00",
"listIntervalEndTime": "2020-11-20T12:01:54.851528+08:00"
}
2020/11/22 19:40:30.331 [D] [server.go:2843] <====Send RequestId:PUT./list-interval/20.1606045230295148000 BodyData:{"code":0,"data":{"listIntervalId":20,"companyId":381,"intervalStartTime":"2020-11-17T12:01:54.851528+08:00","intervalEndTime":"2020-11-20T12:01:54.851528+08:00"},"msg":"ok"}
2020/11/22 19:40:30.331 [D] [server.go:1925] | 127.0.0.1| 200 | 36.18399ms| match| PUT  /list-interval/20 r:/list-interval/:listId
2020/11/22 19:40:35.974 [D] [server.go:2843] ====>Recv User:<nil> RequestId:GET./list-interval/?companyId=381&offset=0&limit=20.1606045235974062000
Auth=
BodyData:{}
2020/11/22 19:40:35.984 [D] [server.go:2843] <====Send RequestId:GET./list-interval/?companyId=381&offset=0&limit=20.1606045235974062000 BodyData:{"code":0,"data":{"count":2,"listIntervals":[{"listIntervalId":20,"companyId":381,"intervalStartTime":"2020-11-17T12:01:54.851528+08:00","intervalEndTime":"2020-11-20T12:01:54.851528+08:00"},{"listIntervalId":7,"companyId":381,"intervalStartTime":"2020-11-10T12:01:54.851528+08:00","intervalEndTime":"2020-11-16T12:01:54.851528+08:00"}]},"msg":"ok"}
2020/11/22 19:40:35.984 [D] [server.go:1925] | 127.0.0.1| 200 | 10.621505ms| match| GET  /list-interval/ r:/list-interval/
... ...
... ... @@ -197,6 +197,7 @@ func (listIntervalService *ListIntervalService) UpdateListInterval(updateListInt
listIntervalRepository = value
}
// 获取当前年榜
listIntervalFound, err := listIntervalRepository.FindOne(map[string]interface{}{"listId": updateListIntervalCommand.ListIntervalId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
... ... @@ -205,19 +206,50 @@ func (listIntervalService *ListIntervalService) UpdateListInterval(updateListInt
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateListIntervalCommand.ListIntervalId)))
}
fmt.Printf("Command: %+v\n", updateListIntervalCommand)
if err := listIntervalFound.Update(tool_funs.SimpleStructToMap(updateListIntervalCommand)); err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
// 获取上一个榜单
listListIntervalQuery := &query.ListListIntervalQuery {
CompanyId: listIntervalFound.CompanyId,
Offset: 1,
Limit: 1,
}
if listIntervalUpdated, err := listIntervalRepository.Save(listIntervalFound); err != nil {
//获取上个年榜时间
_, listIntervals, err := listIntervalRepository.Find(tool_funs.SimpleStructToMap(listListIntervalQuery))
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
// 判断年榜时间是否和上个年榜重叠
if len(listIntervals) > 0 {
if updateListIntervalCommand.ListIntervalStartTime.Before(listIntervals[0].IntervalEndTime) || updateListIntervalCommand.ListIntervalStartTime.Equal(listIntervals[0].IntervalEndTime){
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "年榜开始时间必须大于上一个年榜结束时间")
} else { // 正常更新
if err := listIntervalFound.Update(tool_funs.SimpleStructToMap(updateListIntervalCommand)); err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if listIntervalUpdated, err := listIntervalRepository.Save(listIntervalFound); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return listIntervalUpdated, nil
}
}
} else { // 正常更新
if err := listIntervalFound.Update(tool_funs.SimpleStructToMap(updateListIntervalCommand)); err != nil {
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
if listIntervalUpdated, err := listIntervalRepository.Save(listIntervalFound); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
return listIntervalUpdated, nil
}
return listIntervalUpdated, nil
}
}
... ...
... ... @@ -10,8 +10,9 @@ type ListExchangeCashActivityQuery struct {
CompanyId int64 `json:"companyId"` // 公司id
ActivityNameMatch string `json:"activityNameMatch,omitempty"` // 活动名称匹配
//Deadline time.Time `json:"deadline,omitempty"` // 截止时间筛选
Offset int `json:"offset,omitempty"` // 查询偏移量
Limit int `json:"limit,omitempty"` // 查询限制条目
IsEnd bool `json:"isEnd"` // 已结束活动和未结束活动筛选 true: 已结束活动 false: 未结束活动
Offset int `json:"offset,omitempty"` // 查询偏移量
Limit int `json:"limit,omitempty"` // 查询限制条目
}
func (listExchangeCashActivityQuery *ListExchangeCashActivityQuery) ValidateQuery() error {
... ...
... ... @@ -551,6 +551,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas
"offset": listExchangeCashActivityQuery.Offset,
"limit": listExchangeCashActivityQuery.Limit,
"countdown": 0,
"isEnd": listExchangeCashActivityQuery.IsEnd,
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
... ... @@ -908,7 +909,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
if cashPoolUpdated == nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
} else { // 未更新兑换活动汇率
} else { // 未更新兑换活动汇率 TODO 更新截止时间
updateExchangeCashActivityCommand.ExchangedCash = activityFound.ExchangedCash
}
... ...
... ... @@ -89,7 +89,14 @@ func (repository *ExchangeCashActivityRepository) Find(queryOptions map[string]i
query = query.Where(`exchange_cash_activity.activity_name LIKE ?`, fmt.Sprintf("%%%s%%", activityNameMatch.(string)))
}
if countDown, ok := queryOptions["countDown"]; ok {
query = query.Where(`exchange_cash_activity.countDown = ?`, countDown)
query = query.Where(`exchange_cash_activity.count_down = ?`, countDown)
}
if isEnd, ok := queryOptions["isEnd"]; ok {
if isEnd.(bool) {
query = query.Where(`exchange_cash_activity.count_down = ?`, 0)
} else {
query = query.Where(`exchange_cash_activity.count_down > ?`, 0)
}
}
if deadline, ok := queryOptions["deadline"]; ok && deadline != "" {
t, _ := time.ParseInLocation("2006-01-02", deadline.(string), time.Local)
... ...
... ... @@ -394,32 +394,12 @@ func (controller *SuMoneyController) ExchangeCashListRanking() {
// 导入兑换素币清单
func (controller *SuMoneyController) ImportExchangeList () {
cashPoolService := service.NewCashPoolService(nil)
//importExchangeCashListCommand := &command.ImportExchangeCashListCommand{}
//json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), importExchangeCashListCommand)
where := controller.GetString("where")
//fmt.Printf("%+v\n", importExchangeCashListCommand)
//activityId, _ := strconv.ParseInt(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["activityId"].(string), 10, 64)
//fmt.Print(activityId, "\n")
//fmt.Print(int64(interface{}(importExchangeCashListCommand.Where).(map[string]interface{})["uid"].(float64)), "\n")
file, h, _ := controller.GetFile("file")
jsonMap := make(map[string]interface{})
_ = json.Unmarshal([]byte(where), &jsonMap)
//if reflect.TypeOf(where).Kind() == reflect.TypeOf(jsonMap).Kind() { // 传入json
// jsonMap = map[string]interface{}{
// "activityId": where.(map[string]interface{})["activityId"],
// "uid": where["uid"],
// }
//} else { // 传入json string
// _ := json.Unmarshal([]byte(where), &jsonMap)
//}
//fmt.Printf("%+v\n", jsonMap)
//tmp, _ := strconv.ParseInt(jsonMap["activityId"].(string), 10, 64 )
//fmt.Print(tmp, "\n")
// 错误信息返回
var response utils.JsonResponse
... ...