From 53acd30bf8c47e39c727daf76b141a41dcb26d15 Mon Sep 17 00:00:00 2001 From: wucongxing8150 <815046773@qq.com> Date: Mon, 17 Jun 2024 08:53:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=9C=8D=E5=8A=A1=E5=8C=85=E5=BD=93=E5=89=8D=E6=9C=88?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8C=BA=E9=97=B4=E7=9A=84=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/service/orderServicePackage.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/service/orderServicePackage.go b/api/service/orderServicePackage.go index bc222dd..f863c1b 100644 --- a/api/service/orderServicePackage.go +++ b/api/service/orderServicePackage.go @@ -509,14 +509,14 @@ func (r *OrderServicePackageService) getOrderServicePackageCurrentMonthDate(star } // 获取当前时间 - now := time.Now() + now := time.Now().Unix() // 获取开启服务日期和今日的相差天数 - diff := now.Sub(time.Time(startTime)).Hours() / 24 - diffDays := int(diff) + diff := math.Abs(float64(now - time.Time(startTime).Unix())) + diffDays := math.Ceil(diff / 60 / 60 / 24) // 获取当前月次 - monthTime := math.Ceil(float64(diffDays / 30)) // 向上取整 + monthTime := math.Ceil(diffDays / 30) // 向上取整 days := monthTime * 30