WH01243 3 年之前
父节点
当前提交
9f25a1f5db
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      service/resourceManageService.go

+ 2 - 2
service/resourceManageService.go

@@ -46,10 +46,10 @@ func (service *ResourceManageService) FindAccountBalance(in *resourcesCenter.Res
 	var err error
 	if producMap[in.ResourceType] != nil {
 		err = orm.Table("account_resources").Select("ANY_VALUE(id) as id,ANY_VALUE(name) as name,resourceType,ANY_VALUE(spec)").
-			Where("accountId = ? and endTime =? and  vipTime>?", in.AccountId, endTime, time.Now().Unix()).GroupBy("resourceType").Find(&accountBalanceArr)
+			Where("accountId = ? and endTime =? and  vipTime>? and  resourceType=?  ", in.AccountId, endTime, time.Now().Unix(), in.ResourceType).GroupBy("resourceType").Find(&accountBalanceArr)
 	} else {
 		err = orm.Table("account_resources").Select("ANY_VALUE(id) as id,ANY_VALUE(name) as name,resourceType,ANY_VALUE(spec)").
-			Where("accountId = ? and endTime >= ?", in.AccountId, now).GroupBy("resourceType").Find(&accountBalanceArr)
+			Where("accountId = ? and endTime >= ? and resourceType like  ?", in.AccountId, now, "%字段包%").GroupBy("resourceType").Find(&accountBalanceArr)
 	}
 
 	if err != nil {