|
@@ -63,7 +63,7 @@ func (service *ResourceManageService) FindAccountBalance(in *resourcesCenter.Res
|
|
}
|
|
}
|
|
|
|
|
|
//查询流水账
|
|
//查询流水账
|
|
-func (service *ResourceManageService) FindConsumeRecord(in *resourcesCenter.RecordReq) ([]*resourcesCenter.ConsumeRecord, error) {
|
|
|
|
|
|
+func (service *ResourceManageService) FindConsumeRecord(in *resourcesCenter.RecordReq) ([]*resourcesCenter.ConsumeRecord, int64, error) {
|
|
orm := entity.Engine.NewSession()
|
|
orm := entity.Engine.NewSession()
|
|
var recordArr []*entity.ConsumeRecord
|
|
var recordArr []*entity.ConsumeRecord
|
|
dataList := make([]*resourcesCenter.ConsumeRecord, 0)
|
|
dataList := make([]*resourcesCenter.ConsumeRecord, 0)
|
|
@@ -74,14 +74,14 @@ func (service *ResourceManageService) FindConsumeRecord(in *resourcesCenter.Reco
|
|
Where("accountId = ? and userId = ? and userType = 0", in.AccountId, in.UserId).
|
|
Where("accountId = ? and userId = ? and userType = 0", in.AccountId, in.UserId).
|
|
Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
|
|
Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
|
|
if err != nil && count == 0 {
|
|
if err != nil && count == 0 {
|
|
- return dataList, err
|
|
|
|
|
|
+ return dataList, 0, err
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
count, err = orm.Table("consume_record").
|
|
count, err = orm.Table("consume_record").
|
|
- Where("accountId = ? and userId = ? and userType = 1", in.AccountId, in.UserId).
|
|
|
|
|
|
+ Where("accountId = ? and userType = 1", in.AccountId).
|
|
Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
|
|
Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
|
|
if err != nil && count == 0 {
|
|
if err != nil && count == 0 {
|
|
- return dataList, err
|
|
|
|
|
|
+ return dataList, 0, err
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -98,5 +98,5 @@ func (service *ResourceManageService) FindConsumeRecord(in *resourcesCenter.Reco
|
|
Remarks: v.Remarks,
|
|
Remarks: v.Remarks,
|
|
})
|
|
})
|
|
}
|
|
}
|
|
- return dataList, nil
|
|
|
|
|
|
+ return dataList, count, nil
|
|
}
|
|
}
|