fix(fee):修正错误的文字。
This commit is contained in:
parent
022788bb44
commit
f3457c9ab2
|
@ -197,7 +197,7 @@ func statAdditionalCharges(c *gin.Context) {
|
||||||
result.Error(http.StatusInternalServerError, "不能解析给定的参数[page]。")
|
result.Error(http.StatusInternalServerError, "不能解析给定的参数[page]。")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fees, total, err := service.MaintenanceFeeService.QueryAdditiionalCharges(requestUser, requestPark, period, keyword, requestPage)
|
fees, total, err := service.MaintenanceFeeService.QueryAdditionalCharges(requestUser, requestPark, period, keyword, requestPage)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
result.Error(http.StatusInternalServerError, err.Error())
|
result.Error(http.StatusInternalServerError, err.Error())
|
||||||
return
|
return
|
||||||
|
|
|
@ -175,7 +175,7 @@ type _FeeStat struct {
|
||||||
Total decimal.Decimal
|
Total decimal.Decimal
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f _MaintenanceFeeService) QueryAdditiionalCharges(uid, pid, period, keyword string, requestPage int) ([]model.AdditionalCharge, int64, error) {
|
func (f _MaintenanceFeeService) QueryAdditionalCharges(uid, pid, period, keyword string, requestPage int) ([]model.AdditionalCharge, int64, error) {
|
||||||
var (
|
var (
|
||||||
conditions = []string{fmt.Sprintf("%d", requestPage)}
|
conditions = []string{fmt.Sprintf("%d", requestPage)}
|
||||||
statFees = make([]_FeeStat, 0)
|
statFees = make([]_FeeStat, 0)
|
||||||
|
@ -250,14 +250,14 @@ func (f _MaintenanceFeeService) QueryAdditiionalCharges(uid, pid, period, keywor
|
||||||
mapset.NewSet[string](),
|
mapset.NewSet[string](),
|
||||||
)
|
)
|
||||||
parks := make([]model.Park, 0)
|
parks := make([]model.Park, 0)
|
||||||
err = global.DB.NewSelect().Model(&parks).Relation("Enterprise").
|
if len(parkIds.ToSlice()) > 0 {
|
||||||
Where("p.id in (?)", bun.In(parkIds.ToSlice())).
|
err = global.DB.NewSelect().Model(&parks).Relation("Enterprise").
|
||||||
Scan(ctx)
|
Where("p.id in (?)", bun.In(parkIds.ToSlice())).
|
||||||
if err != nil {
|
Scan(ctx)
|
||||||
return make([]model.AdditionalCharge, 0), 0, fmt.Errorf("获取园区信息出现错误,%w", err)
|
if err != nil {
|
||||||
|
return make([]model.AdditionalCharge, 0), 0, fmt.Errorf("获取园区信息出现错误,%w", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
f.l.Debug("Park ids", zap.Any("ids", parkIds))
|
|
||||||
f.l.Debug("Check fees", zap.Any("fees", statFees))
|
|
||||||
assembledStat := lo.Reduce(
|
assembledStat := lo.Reduce(
|
||||||
statFees,
|
statFees,
|
||||||
func(acc []model.AdditionalCharge, elem _FeeStat, _ int) []model.AdditionalCharge {
|
func(acc []model.AdditionalCharge, elem _FeeStat, _ int) []model.AdditionalCharge {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user