作者 陈志颖

fix:修复排行榜

... ... @@ -408,7 +408,7 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivityDeadline(listExc
var deadlines []interface{}
for _, activity := range activities {
//tmpTime := activity.Deadline.UTC().Format("2006-01-02")
tmpTime := activity.Deadline.Format("2006-01-02")
tmpTime := activity.Deadline.Local().Format("2006-01-02")
if !utils.IsContain(deadlines, tmpTime) {
deadlines = append(deadlines, tmpTime)
}
... ... @@ -498,10 +498,10 @@ func (cashPoolService *CashPoolService) SearchExchangeCashActivity(activityComma
"exchangedCash": cash,
"exchangedSuMoney": suMoney,
//"deadline": activity.Deadline.UTC().Format("2006-01-02"),
"deadline": activity.Deadline,
"deadline": activity.Deadline.Local(),
"countDown": activity.CountDown,
"rate": activity.Rate,
"createTime": activity.CreateTime,
"createTime": activity.CreateTime.Local(),
//"createTime": activity.CreateTime.UTC(),
}
activitiesFormat = append(activitiesFormat, activityFormat)
... ... @@ -597,10 +597,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashActivity(listExchangeCas
"companyId": activity.CompanyId,
"exchangedCash": cash,
"exchangedSuMoney": suMoney,
"deadline": activity.Deadline.UnixNano() / 1e6, // 秒级时间戳转换
"deadline": activity.Deadline.Local().UnixNano() / 1e6, // 秒级时间戳转换
"countDown": activity.CountDown,
"rate": activity.Rate,
"createTime": activity.CreateTime,
"createTime": activity.CreateTime.Local(),
}
activitiesWithTs = append(activitiesWithTs, activityWithTs)
}
... ... @@ -659,6 +659,8 @@ func (cashPoolService *CashPoolService) RemoveExchangeCashActivity(removeExchang
if err := transactionContext.CommitTransaction(); err != nil {
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
}
activityDeleted.CreateTime = activityDeleted.CreateTime.Local()
activityDeleted.Deadline = activityDeleted.Deadline.Local()
return activityDeleted, nil
}
}
... ... @@ -734,6 +736,8 @@ func (cashPoolService *CashPoolService) GetExchangeCashActivity(getExchangeCashA
}
activityUpdated.ExchangedSuMoney, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedSuMoney), 64)
activityUpdated.ExchangedCash, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedCash), 64)
activityUpdated.Deadline = activityUpdated.Deadline.Local()
activityUpdated.CreateTime = activityUpdated.CreateTime.Local()
return activityUpdated, nil
}
}
... ... @@ -929,6 +933,8 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashActivity(updateExchang
}
activityUpdated.ExchangedSuMoney, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedSuMoney), 64)
activityUpdated.ExchangedCash, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", activityUpdated.ExchangedCash), 64)
activityUpdated.Deadline = activityUpdated.Deadline.Local()
activityUpdated.CreateTime = activityUpdated.CreateTime.Local()
return activityUpdated, nil
}
}
... ...
... ... @@ -407,7 +407,7 @@ func (dao *EmployeeDao) ContributionsWealthRanking(queryOptions map[string]inter
queryContributions = queryContributions.ColumnExpr("ROW_NUMBER() OVER (ORDER BY sum(su_money_transaction_records.su_money) - t.employee_contributions_decrease DESC) AS ranking")
queryContributions = queryContributions.Where(`su_money_transaction_records.record_type IN (?)`, pg.In([]int{2, 3}))
queryContributions = queryContributions.Where(`e.status = ?`, 1)
queryContributions = queryContributions.Where("e.uid = t.uid::bigint")
//queryContributions = queryContributions.Where("e.uid = t.uid::bigint")
if companyId, ok := queryOptions["companyId"]; ok && (companyId.(int64) != 0) {
queryContributions = queryContributions.Where("e.company_id = ?", companyId)
}
... ...
... ... @@ -406,7 +406,7 @@ func (controller *SuMoneyController) ImportExchangeList () {
ret := map[string]interface{}{}
// 返回信息表头定义
var tableHeader = [...]string{"错误详情", "员工姓名", "手机号", "已兑换素币"}
var tableHeader = [...]string{"员工姓名", "手机号", "已兑换素币", "错误详情"}
// 文件后缀名校验
ext := path.Ext(h.Filename)
... ...