作者 陈志颖

fix:修复排行榜

@@ -408,7 +408,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivityDeadline(listExc @@ -408,7 +408,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivityDeadline(listExc
408 var deadlines []interface{} 408 var deadlines []interface{}
409 for _, activity := range activities { 409 for _, activity := range activities {
410 //tmpTime := activity.Deadline.UTC().Format("2006-01-02") 410 //tmpTime := activity.Deadline.UTC().Format("2006-01-02")
411 - tmpTime := activity.Deadline.Format("2006-01-02") 411 + tmpTime := activity.Deadline.Local().Format("2006-01-02")
412 if !utils.IsContain(deadlines, tmpTime) { 412 if !utils.IsContain(deadlines, tmpTime) {
413 deadlines = append(deadlines, tmpTime) 413 deadlines = append(deadlines, tmpTime)
414 } 414 }
@@ -498,10 +498,10 @@ func (cashPoolService *CashPoolService) SearchExchangeCashActivity(activityComma @@ -498,10 +498,10 @@ func (cashPoolService *CashPoolService) SearchExchangeCashActivity(activityComma
498 "exchangedCash": cash, 498 "exchangedCash": cash,
499 "exchangedSuMoney": suMoney, 499 "exchangedSuMoney": suMoney,
500 //"deadline": activity.Deadline.UTC().Format("2006-01-02"), 500 //"deadline": activity.Deadline.UTC().Format("2006-01-02"),
501 - "deadline": activity.Deadline, 501 + "deadline": activity.Deadline.Local(),
502 "countDown": activity.CountDown, 502 "countDown": activity.CountDown,
503 "rate": activity.Rate, 503 "rate": activity.Rate,
504 - "createTime": activity.CreateTime, 504 + "createTime": activity.CreateTime.Local(),
505 //"createTime": activity.CreateTime.UTC(), 505 //"createTime": activity.CreateTime.UTC(),
506 } 506 }
507 activitiesFormat = append(activitiesFormat, activityFormat) 507 activitiesFormat = append(activitiesFormat, activityFormat)
@@ -597,10 +597,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas @@ -597,10 +597,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas
597 "companyId": activity.CompanyId, 597 "companyId": activity.CompanyId,
598 "exchangedCash": cash, 598 "exchangedCash": cash,
599 "exchangedSuMoney": suMoney, 599 "exchangedSuMoney": suMoney,
600 - "deadline": activity.Deadline.UnixNano() / 1e6, // 秒级时间戳转换 600 + "deadline": activity.Deadline.Local().UnixNano() / 1e6, // 秒级时间戳转换
601 "countDown": activity.CountDown, 601 "countDown": activity.CountDown,
602 "rate": activity.Rate, 602 "rate": activity.Rate,
603 - "createTime": activity.CreateTime, 603 + "createTime": activity.CreateTime.Local(),
604 } 604 }
605 activitiesWithTs = append(activitiesWithTs, activityWithTs) 605 activitiesWithTs = append(activitiesWithTs, activityWithTs)
606 } 606 }
@@ -659,6 +659,8 @@ func (cashPoolService *CashPoolService) RemoveExchangeCashActivity(removeExchang @@ -659,6 +659,8 @@ func (cashPoolService *CashPoolService) RemoveExchangeCashActivity(removeExchang
659 if err := transactionContext.CommitTransaction(); err != nil { 659 if err := transactionContext.CommitTransaction(); err != nil {
660 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 660 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
661 } 661 }
  662 + activityDeleted.CreateTime = activityDeleted.CreateTime.Local()
  663 + activityDeleted.Deadline = activityDeleted.Deadline.Local()
662 return activityDeleted, nil 664 return activityDeleted, nil
663 } 665 }
664 } 666 }
@@ -734,6 +736,8 @@ func (cashPoolService *CashPoolService) GetExchangeCashActivity(getExchangeCashA @@ -734,6 +736,8 @@ func (cashPoolService *CashPoolService) GetExchangeCashActivity(getExchangeCashA
734 } 736 }
735 activityUpdated.ExchangedSuMoney, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedSuMoney), 64) 737 activityUpdated.ExchangedSuMoney, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedSuMoney), 64)
736 activityUpdated.ExchangedCash, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedCash), 64) 738 activityUpdated.ExchangedCash, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedCash), 64)
  739 + activityUpdated.Deadline = activityUpdated.Deadline.Local()
  740 + activityUpdated.CreateTime = activityUpdated.CreateTime.Local()
737 return activityUpdated, nil 741 return activityUpdated, nil
738 } 742 }
739 } 743 }
@@ -929,6 +933,8 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang @@ -929,6 +933,8 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
929 } 933 }
930 activityUpdated.ExchangedSuMoney, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedSuMoney), 64) 934 activityUpdated.ExchangedSuMoney, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedSuMoney), 64)
931 activityUpdated.ExchangedCash, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedCash), 64) 935 activityUpdated.ExchangedCash, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedCash), 64)
  936 + activityUpdated.Deadline = activityUpdated.Deadline.Local()
  937 + activityUpdated.CreateTime = activityUpdated.CreateTime.Local()
932 return activityUpdated, nil 938 return activityUpdated, nil
933 } 939 }
934 } 940 }
@@ -407,7 +407,7 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter @@ -407,7 +407,7 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter
407 queryContributions = queryContributions.ColumnExpr("ROW_NUMBER() OVER (ORDER BY sum(su_money_transaction_records.su_money) - t.employee_contributions_decrease DESC) AS ranking") 407 queryContributions = queryContributions.ColumnExpr("ROW_NUMBER() OVER (ORDER BY sum(su_money_transaction_records.su_money) - t.employee_contributions_decrease DESC) AS ranking")
408 queryContributions = queryContributions.Where(`su_money_transaction_records.record_type IN (?)`, pg.In([]int{2, 3})) 408 queryContributions = queryContributions.Where(`su_money_transaction_records.record_type IN (?)`, pg.In([]int{2, 3}))
409 queryContributions = queryContributions.Where(`e.status = ?`, 1) 409 queryContributions = queryContributions.Where(`e.status = ?`, 1)
410 - queryContributions = queryContributions.Where("e.uid = t.uid::bigint") 410 + //queryContributions = queryContributions.Where("e.uid = t.uid::bigint")
411 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) { 411 if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
412 queryContributions = queryContributions.Where("e.company_id = ?", companyId) 412 queryContributions = queryContributions.Where("e.company_id = ?", companyId)
413 } 413 }
@@ -406,7 +406,7 @@ func (controller *SuMoneyController) ImportExchangeList () { @@ -406,7 +406,7 @@ func (controller *SuMoneyController) ImportExchangeList () {
406 ret := map[string]interface{}{} 406 ret := map[string]interface{}{}
407 407
408 // 返回信息表头定义 408 // 返回信息表头定义
409 - var tableHeader = [...]string{"错误详情", "员工姓名", "手机号", "已兑换素币"} 409 + var tableHeader = [...]string{"员工姓名", "手机号", "已兑换素币", "错误详情"}
410 410
411 // 文件后缀名校验 411 // 文件后缀名校验
412 ext := path.Ext(h.Filename) 412 ext := path.Ext(h.Filename)