Răsfoiți Sursa

自定义时间

wangchuanjin 2 ani în urmă
părinte
comite
e50314229b
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      public/entity/base_power.go

+ 2 - 2
public/entity/base_power.go

@@ -103,10 +103,10 @@ func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, us
 				}
 				if end_time == "" {
 					now := time.Now()
-					end := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, time.Local)
+					end := time.Date(now.Year(), now.Month(), now.Day(), 23, 59, 59, 0, time.Local)
 					if strings.HasSuffix(v.Cycle, "d") {
 						cycle := IntAll(strings.TrimSuffix(v.Cycle, "d"))
-						end = end.AddDate(0, 0, cycle)
+						end = end.AddDate(0, 0, cycle-1)
 					} else if strings.HasSuffix(v.Cycle, "m") {
 						cycle := IntAll(strings.TrimSuffix(v.Cycle, "m"))
 						end = end.AddDate(0, cycle, 0)