作者 陈志颖

fix:修改活动截止时间筛选返回结果

... ... @@ -295,9 +295,7 @@ func (cashPoolService *CashPoolService) CreateExchangeCashActivity(createExchang
dd, _ := time.ParseDuration("24h")
var deadline = createExchangeCashActivityCommand.Deadline.Add(dd)
var t1 = time.Now()
var t2 = time.Date(deadline.Year(), deadline.Month(), deadline.Day(), 23, 59, 59, 0, time.UTC)
//countDown := math.Ceil(t2.Sub(t1).Hours() / 24)
//fmt.Print(math.Ceil(t2.Sub(t1).Hours() / 24), "\n")
var t2 = time.Date(deadline.Year(), deadline.Month(), deadline.Day(), 23, 59, 59, 0, time.Local)
// 创建兑换活动命令
newActivity := &domain.ExchangeCashActivity{
... ... @@ -655,7 +653,6 @@ func (cashPoolService *CashPoolService) GetExchangeCashActivity(getExchangeCashA
// 倒计时结束处理
if t2.Before(t1) {
updateExchangeCashActivity.CountDown = 0
updateExchangeCashActivity.Deadline = activityFound.Deadline
}
// 更新兑换现活动
... ... @@ -1957,8 +1954,6 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP
}
}
// 更新兑换素币清单
// 移除兑换素币清单
func (cashPoolService *CashPoolService) RemoveExchangeCashPerson(removeExchangeCashPersonCommand *command.RemoveExchangeCashPersonCommand) (interface{}, error) {
if err := removeExchangeCashPersonCommand.ValidateCommand(); err != nil {
... ...
... ... @@ -89,12 +89,11 @@ func (repository *ExchangeCashActivityRepository) Find(queryOptions map[string]i
query = query.Where(`exchange_cash_activity.activity_name LIKE ?`, fmt.Sprintf("%%%s%%", activityNameMatch.(string)))
}
if deadline, ok := queryOptions["deadline"]; ok && deadline != "" {
fmt.Print(deadline, "\n")
t, _ := time.ParseInLocation("2006-01-02", deadline.(string), time.UTC)
fmt.Print(t, "\n")
//newDeadline := time.Date(t.Year(), t.Month(), t.Day(), 23, 59, 59, 0, time.UTC)
//fmt.Print(newDeadline, "\n")
query = query.Where(`exchange_cash_activity.deadline >= ?`, t)
newDeadlineStart := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.UTC)
newDeadlineEnd := time.Date(t.Year(), t.Month(), t.Day() + 1, 0, 0, 0, 0 - 1, time.UTC)
query = query.Where(`exchange_cash_activity.deadline >= ?`, newDeadlineStart)
query = query.Where(`exchange_cash_activity.deadline <= ?`, newDeadlineEnd)
}
if offset, ok := queryOptions["offset"]; ok {
offset := offset.(int)
... ...