From e62abdad319c127c797cf67a38445909c2901e2d Mon Sep 17 00:00:00 2001 From: li Date: Tue, 9 May 2023 11:37:56 +0800 Subject: [PATCH] fix: --- controller/game_card.go | 1 + go.mod | 2 +- go.sum | 2 -- model/invite.go | 1 + model/model_test.go | 7 +++++++ model/user.go | 3 ++- pack/examine.sh | 2 +- 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/controller/game_card.go b/controller/game_card.go index 480b230..5f2071f 100644 --- a/controller/game_card.go +++ b/controller/game_card.go @@ -620,6 +620,7 @@ func PushWXPayNotice(c *gin.Context) { MemberLevel: record.MemberLevel, UserInviteRecordId: inviteRecordNew.ID, FirstInvite: 0, + Scan: 0, } if isShopAssistantCode { userInviteNew.InviteForm = 1 diff --git a/go.mod b/go.mod index 41bc992..483eb93 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/gin-gonic/gin v1.7.1 github.com/holdno/snowFlakeByGo v0.0.0-20180510033652-d23f8a8cadd7 github.com/jinzhu/gorm v1.9.16 + github.com/jinzhu/now v1.1.4 // indirect github.com/medivhzhan/weapp v1.5.1 github.com/pkg/errors v0.9.1 github.com/qiniu/api.v7 v7.2.5+incompatible @@ -21,6 +22,5 @@ require ( github.com/wechatpay-apiv3/wechatpay-go v0.2.6 github.com/xuri/excelize/v2 v2.6.0 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 - gorm.io/gorm v1.24.3 qiniupkg.com/x v7.0.8+incompatible // indirect ) diff --git a/go.sum b/go.sum index 30a07ba..e31512e 100644 --- a/go.sum +++ b/go.sum @@ -437,8 +437,6 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gorm.io/gorm v1.24.3 h1:WL2ifUmzR/SLp85CSURAfybcHnGZ+yLSGSxgYXlFBHg= -gorm.io/gorm v1.24.3/go.mod h1:DVrVomtaYTbqs7gB/x2uVvqnXzv0nqjB396B8cG4dBA= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/model/invite.go b/model/invite.go index 5241392..883962f 100644 --- a/model/invite.go +++ b/model/invite.go @@ -29,5 +29,6 @@ type UserInviteRecord struct { First uint32 `json:"first"` // 首次 Scan uint32 `json:"scan"` // 扫码 ActionTime time.Time `json:"action_time"` // 激活时间 + RenewHide uint32 `json:"renew_hide"` // 自动续费 // user_invite_record } diff --git a/model/model_test.go b/model/model_test.go index f79199f..2e2e7ba 100644 --- a/model/model_test.go +++ b/model/model_test.go @@ -165,6 +165,7 @@ func InitTestDB() { &ShopperPromotionCode{}, &UserOpenMemberRecord{}, &UserInvite{}, + &UserInviteRecord{}, &User{}, ) @@ -215,6 +216,7 @@ func InitDBProd() { &UserCoupon{}, &UserOpenMemberRecord{}, &UserInvite{}, + &UserInviteRecord{}, &User{}, ) @@ -2581,3 +2583,8 @@ func GetMonth(date string) string { func TestNameSunHash(t *testing.T) { } + +func UserCardStock() { + // 1. + +} diff --git a/model/user.go b/model/user.go index d5e0652..5a9f283 100644 --- a/model/user.go +++ b/model/user.go @@ -105,6 +105,7 @@ type UserInvite struct { FirstInvite uint32 `json:"first_invite"` // 首次 Scan uint32 `json:"scan"` // 扫码 InviteForm uint32 `json:"invite_form"` // 邀请方式: 1-店员邀请码续费 + RenewHide uint32 `json:"renew_hide"` // 自动续费 //InviteTime time.Time `json:"invite_time"` // 邀请时间 ToUser *User `json:"to_user" gorm:"-"` @@ -963,7 +964,7 @@ func MemberExpireDelaying(uid uint32) (map[string]interface{}, error) { orderCard.CardStatus = uint32(order.CardStatus) } deadline := orderCard.RevertTime - if orderCard.CardStatus != 4 { + if orderCard.CardStatus > 0 && orderCard.CardStatus != 4 { deadline = time.Now() } if user.MemberLevel == 3 { diff --git a/pack/examine.sh b/pack/examine.sh index 17bc015..bcf7538 100644 --- a/pack/examine.sh +++ b/pack/examine.sh @@ -6,7 +6,7 @@ do then echo "server service is ok" else - echo "server servicie not exist" + echo "server service not exist" nohup ./hm_server > server.log 2>&1 & fi sleep 60