|
@@ -161,6 +161,16 @@ func (service *ResourceManageService) FindConsumeRecord(in *resourcesCenter.Reco
|
|
|
Where("accountId = ? and userType>0 and resourceType like ? ", in.AccountId, "%"+in.ResourceType+"%").
|
|
|
Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
|
|
|
}
|
|
|
+ case -1:
|
|
|
+ if in.QueryTime != "" {
|
|
|
+ count, err = orm.Table("consume_record").
|
|
|
+ Where("accountId = ? and resourceType like ? and DATE_FORMAT( createTime, '%Y-%m' ) = ?", in.AccountId, "%"+in.ResourceType+"%", in.QueryTime).
|
|
|
+ Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
|
|
|
+ } else {
|
|
|
+ count, err = orm.Table("consume_record").
|
|
|
+ Where("accountId = ? and resourceType like ? ", in.AccountId, "%"+in.ResourceType+"%").
|
|
|
+ Limit(int(in.PageSize), (int(in.Page)-1)*int(in.PageSize)).OrderBy("id desc").FindAndCount(&recordArr)
|
|
|
+ }
|
|
|
}
|
|
|
if err != nil && count == 0 {
|
|
|
return dataList, 0, err
|