diff --git a/controllers/pc/login.go b/controllers/pc/login.go index bc9eab8..eeb17cc 100644 --- a/controllers/pc/login.go +++ b/controllers/pc/login.go @@ -62,7 +62,7 @@ func (t *UserCtl) Checkin() { // debug func (t *UserCtl) DebugLogin() { - customerId := t.DefaultInt64("customer_id", 19) + customerId := t.DefaultInt64("customer_id", 1) customer := new(models.Customer) exist, err := models.GetById(customer, customerId) t.CheckErr(err) diff --git a/controllers/pc/sign.go b/controllers/pc/sign.go index 0a0d345..ef003ac 100644 --- a/controllers/pc/sign.go +++ b/controllers/pc/sign.go @@ -92,7 +92,7 @@ func (t *SignCtl) RealSignInfo() { aid := t.MustGetActivityId() rid := t.MustGetInt64("rehearsal_id") results := make([]*models.RealSignHistory, 0) - err := core.GetXormAuto().Where("is_delete=0 and activity_id=? and rehearsal_id=? status=0", + err := core.GetXormAuto().Where("is_delete=0 and activity_id=? and rehearsal_id=? and status=0", aid, rid).Asc("updated_at").Find(results) t.CheckErr(err) t.JSON(map[string]interface{}{ @@ -101,7 +101,7 @@ func (t *SignCtl) RealSignInfo() { }) } -func (t *SignCtl) RealSignReward() { +func (t *SignCtl) RealSignVerify() { id := t.MustGetInt64("real_sign_history_id") // 获取历史信息 history := new(models.RealSignHistory) diff --git a/log/hdzj.log b/log/hdzj.log index bff7906..089e80e 100644 --- a/log/hdzj.log +++ b/log/hdzj.log @@ -3,3 +3,5 @@ 2020-03-09 12:19:33.431 ERROR logger/logger.go:92 check err {"error": "Error 1054: Unknown column 'user_id' in 'field list'", "errorVerbose": "Error 1054: Unknown column 'user_id' in 'field list'\nhudongzhuanjia/models.(*RealSignList).CheckSignIn\n\tE:/GoProject/src/hd/models/real_sign_list.go:27\nhudongzhuanjia/controllers/client.(*SignCtl).RealSign\n\tE:/GoProject/src/hd/controllers/client/sign.go:109\nreflect.Value.call\n\tE:/Go/src/reflect/value.go:460\nreflect.Value.Call\n\tE:/Go/src/reflect/value.go:321\ngithub.com/ouxuanserver/osmanthuswine/src/core.(*RouterManage).RouterSend\n\tE:/GoProject/pkg/mod/github.com/ouxuanserver/osmanthuswine@v0.0.0-20190916032555-480efadf4941/src/core/router.go:111\ngithub.com/ouxuanserver/osmanthuswine.RunProg.func1\n\tE:/GoProject/pkg/mod/github.com/ouxuanserver/osmanthuswine@v0.0.0-20190916032555-480efadf4941/osmanthuswine.go:112\nnet/http.HandlerFunc.ServeHTTP\n\tE:/Go/src/net/http/server.go:2007\ngithub.com/go-chi/chi.(*Mux).routeHTTP\n\tE:/GoProject/pkg/mod/github.com/go-chi/chi@v4.0.2+incompatible/mux.go:425\nnet/http.HandlerFunc.ServeHTTP\n\tE:/Go/src/net/http/server.go:2007\ngithub.com/go-chi/chi/middleware.Timeout.func1.1\n\tE:/GoProject/pkg/mod/github.com/go-chi/chi@v4.0.2+incompatible/middleware/timeout.go:45\nnet/http.HandlerFunc.ServeHTTP\n\tE:/Go/src/net/http/server.go:2007\ngithub.com/go-chi/chi/middleware.Recoverer.func1\n\tE:/GoProject/pkg/mod/github.com/go-chi/chi@v4.0.2+incompatible/middleware/recoverer.go:35\nnet/http.HandlerFunc.ServeHTTP\n\tE:/Go/src/net/http/server.go:2007\ngithub.com/go-chi/chi/middleware.RequestLogger.func1.1\n\tE:/GoProject/pkg/mod/github.com/go-chi/chi@v4.0.2+incompatible/middleware/logger.go:46\nnet/http.HandlerFunc.ServeHTTP\n\tE:/Go/src/net/http/server.go:2007\ngithub.com/go-chi/chi/middleware.RealIP.func1\n\tE:/GoProject/pkg/mod/github.com/go-chi/chi@v4.0.2+incompatible/middleware/realip.go:34\nnet/http.HandlerFunc.ServeHTTP\n\tE:/Go/src/net/http/server.go:2007\ngithub.com/go-chi/chi/middleware.RequestID.func1\n\tE:/GoProject/pkg/mod/github.com/go-chi/chi@v4.0.2+incompatible/middleware/request_id.go:72\nnet/http.HandlerFunc.ServeHTTP\n\tE:/Go/src/net/http/server.go:2007\ngithub.com/go-chi/chi.(*Mux).ServeHTTP\n\tE:/GoProject/pkg/mod/github.com/go-chi/chi@v4.0.2+incompatible/mux.go:82\nnet/http.serverHandler.ServeHTTP\n\tE:/Go/src/net/http/server.go:2802\nnet/http.(*conn).serve\n\tE:/Go/src/net/http/server.go:1890\nruntime.goexit\n\tE:/Go/src/runtime/asm_amd64.s:1357"} 2020-03-09 12:23:40.321 ERROR logger/logger.go:92 check err {"error": "Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%json_list like %)' at line 1"} 2020-03-09 12:40:14.756 ERROR logger/logger.go:92 check err {"error": "Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%张三% and json_list like %张三% )' at line 1"} +2020-03-12 10:06:16.154 ERROR logger/logger.go:92 check err {"error": "token invalid"} +2020-03-12 10:07:26.864 ERROR logger/logger.go:92 check err {"error": "Error 1146: Table 'hudongzhuanjia.ox_real_sign_history' doesn't exist"} diff --git a/models/init_models.go b/models/init_models.go index f98b89d..83a3d1c 100644 --- a/models/init_models.go +++ b/models/init_models.go @@ -83,6 +83,7 @@ func init() { new(UserRefund), new(UserRedPack), new(RealSignList), + new(RealSignHistory), ) fmt.Printf("error=======>%v\n\n", err) } diff --git a/models/real_sign_history.go b/models/real_sign_history.go index 489817f..f3f9404 100644 --- a/models/real_sign_history.go +++ b/models/real_sign_history.go @@ -14,8 +14,8 @@ type RealSignHistory struct { Nickname string `json:"nickname" xorm:"not null default('') comment('微信昵称') VARCHAR(128)"` RehearsalId int64 `json:"rehearsal_id" xorm:"not null default 0 comment('彩排id') INT(11)"` Content string `json:"content" xorm:"not null comment('提交审核的内容') TEXT"` - Status int64 `json:"status" xorm:"not null default 0 comment('是否通过审核') TINY(1)"` - IsDelete int `json:"is_delete" xorm:"not null default(0) comment('是否删除') TINY(1)"` + Status int64 `json:"status" xorm:"not null default 0 comment('是否通过审核') TINYINT(1)"` + IsDelete int `json:"is_delete" xorm:"not null default(0) comment('是否删除') TINYINT(1)"` CreatedAt time.Time `json:"created_at" xorm:"not null created comment('创建时间') DATETIME"` UpdatedAt time.Time `json:"updated_at" xorm:"not null updated comment('更新时间') TIMESTAMP"` }