diff --git a/controllers/common/wechat_oauth.go b/controllers/common/wechat_oauth.go index d7e13d4..fe10541 100644 --- a/controllers/common/wechat_oauth.go +++ b/controllers/common/wechat_oauth.go @@ -106,6 +106,7 @@ func (t *WeChatOauthCtl) CallbackRefund() { _, err := pay_service.NotifyRefund(t.Request.BODY) param := new(CallbackParam) if err != nil { + logger.Error(err) refundFailedCounter.Add(1) logger.Error(fmt.Sprintf("call refund失败微信响应次数: %v", refundFailedCounter.Load())) param.ReturnCode = CDATA{Text: define.CODE_FAIL} diff --git a/models/live_config.go b/models/live_config.go index 42b3344..e26ce99 100644 --- a/models/live_config.go +++ b/models/live_config.go @@ -35,6 +35,7 @@ type LiveConfig struct { ActivityDesc string `json:"activity_desc" xorm:"not null default '' comment('活动介绍页图片') VARCHAR(255)"` SharePosterImg string `json:"share_poster_img" xorm:"not null default '' comment('分享的海报图片') VARCHAR(255)"` Status int `json:"status" xorm:"not null default 1 comment('直播的状态1未开始2进行中3已结束') TINYINT(1)"` + LiveMode int `json:"live_mode" xorm:"not null default 1 comment('直播方式1标准直播2快直播') TINYINT(1)"` Announcement string `json:"announcement" xorm:"not null default '' comment('公告内容') VARCHAR(255)"` WatchNum int `json:"watch_num" xorm:"not null default 0 comment('观看人数') INT(11)"` LikeNum int `json:"like_num" xorm:"not null default 0 comment('点赞数') INT(11)"` diff --git a/services/pay/order.go b/services/pay/order.go index d8be0cd..6a1d911 100644 --- a/services/pay/order.go +++ b/services/pay/order.go @@ -303,26 +303,26 @@ func NotifyRefund(body string) (*models.UserOrder, error) { err := xml.Unmarshal([]byte(body), &res) if err != nil { err = fmt.Errorf("xml unmarsal error: %+v", err) - logger.Error(err) return nil, err } + logger.Error("return-->", res.ReturnCode == define.CODE_SUCCESS) + logger.Error("result-->", res.ResultCode == define.CODE_SUCCESS) + logger.Error(res) if res.ReturnCode != define.CODE_SUCCESS { err = fmt.Errorf("network error, retrun_code: %+v and return_msg: %+v", res.ReturnCode, res.ReturnMsg) - logger.Error(err) return nil, err } if res.ResultCode != define.CODE_SUCCESS { err = fmt.Errorf("trade error, result_code: %+v and err_code: %+v and err_desc: %+v", res.ResultCode, res.ErrCode, res.ErrCodeDes) - logger.Error(err) return nil, err } order := new(models.UserOrder) exist, err := order.GetByOutTradeNo(res.OutTradeNo) - if err == nil || !exist { + if err != nil || !exist { err = fmt.Errorf("user order get by out_trade_no: %+v, error: %+v, exist: %+v", res.OutTradeNo, err, exist) return nil, err }