作者 陈志颖

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

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