123456789101112131415161718192021222324252627282930 |
- package service
-
- import (
- "errors"
- "time"
- "wsc-go/models"
- )
-
- func GetOrgSubscibeState(subscibe *models.ServeSubscibe) (err error) {
- if subscibe == nil {
- err = errors.New("没有订阅信息")
- return
- }
-
- //免费试用版2,永久免费版9 不过期
- if subscibe.State == 9 || subscibe.State == 2 {
- return
- }
-
- timeNow := time.Now().Unix()
- if timeNow < subscibe.PeriodStart || timeNow > subscibe.PeriodEnd {
- subscibe.State = 3
- }
- if subscibe.State != 1 && subscibe.State != 8 {
- subscibe.State = 3
- }
- return
-
- }
|