Эх сурвалжийг харах

Merge branch 'dev_v1.0.7_wh' of moapp/jyResourcesCenter into feature/v1.0.7

王浩 5 сар өмнө
parent
commit
1ea64af57e

+ 1 - 6
service/resourceManageService.go

@@ -57,11 +57,7 @@ func (service *ResourceManageService) FindAccountBalance(in *resourcesCenter.Res
 	}
 	}
 	for _, v := range accountBalanceArr {
 	for _, v := range accountBalanceArr {
 		now1 := time.Now()
 		now1 := time.Now()
-		currentYear, currentMonth, _ := now1.Date()
-		currentLocation := now1.Location()
-		firstOfMonth := time.Date(currentYear, currentMonth, 1, 0, 0, 0, 0, currentLocation)
-		lastOfMonth := firstOfMonth.AddDate(0, 1, -1)
-		endTime := lastOfMonth.Format("2006-01-02")
+		endTime := now1.AddDate(0, 0, 30).Format("2006-01-02")
 		//统计30内到期数量
 		//统计30内到期数量
 
 
 		//统计总数量
 		//统计总数量
@@ -108,7 +104,6 @@ func (service *ResourceManageService) FindAccountBalance(in *resourcesCenter.Res
 				}
 				}
 			}
 			}
 		} else {
 		} else {
-			var c int64
 			b, err = orm.Table("account_resources").Select("sum(number) as number").
 			b, err = orm.Table("account_resources").Select("sum(number) as number").
 				Where("accountId = ? and resourceType = ? and endTime >= ? and endTime <= ?",
 				Where("accountId = ? and resourceType = ? and endTime >= ? and endTime <= ?",
 					in.AccountId, v.ResourceType, now, endTime).Get(&c)
 					in.AccountId, v.ResourceType, now, endTime).Get(&c)