修改了 获取服务包当前月时间区间的计算方式
This commit is contained in:
parent
d1a7f5b980
commit
53acd30bf8
@ -509,14 +509,14 @@ func (r *OrderServicePackageService) getOrderServicePackageCurrentMonthDate(star
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取当前时间
|
// 获取当前时间
|
||||||
now := time.Now()
|
now := time.Now().Unix()
|
||||||
|
|
||||||
// 获取开启服务日期和今日的相差天数
|
// 获取开启服务日期和今日的相差天数
|
||||||
diff := now.Sub(time.Time(startTime)).Hours() / 24
|
diff := math.Abs(float64(now - time.Time(startTime).Unix()))
|
||||||
diffDays := int(diff)
|
diffDays := math.Ceil(diff / 60 / 60 / 24)
|
||||||
|
|
||||||
// 获取当前月次
|
// 获取当前月次
|
||||||
monthTime := math.Ceil(float64(diffDays / 30)) // 向上取整
|
monthTime := math.Ceil(diffDays / 30) // 向上取整
|
||||||
|
|
||||||
days := monthTime * 30
|
days := monthTime * 30
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user