Browse Source

fix:bug

token_replace
黄梓健 5 years ago
parent
commit
770af7326d
  1. 1
      controllers/client/login.go
  2. 8
      controllers/pc/bully_screen.go
  3. 2
      controllers/pc/reward.go
  4. 2
      go.mod
  5. 2
      go.sum
  6. 4
      services/bully_reward/dao.go

1
controllers/client/login.go

@ -65,6 +65,7 @@ func (t *UserCtl) WxLogin() {
logger.Error("微信code:", wxcode)
activity, exist, err := activity_service.GetActivityById(activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在")
customer := new(models.Customer)
exist, err = models.Get(customer, activity.CustomerId)

8
controllers/pc/bully_screen.go

@ -159,12 +159,14 @@ func (t *BullyScreenCtl) Latest() {
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在")
//获取霸屏服务得id
bullyScreenServer := new(models.BullyScreenServer)
exist, err = bullyScreenServer.GetByActivityId(activityId)
server := new(models.BullyScreenServer)
exist, err = server.GetByActivityId(activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_BULLY_SCREEN_SERVER_NOT_EXIST, "霸屏不存在")
result, err := bully_reward_service.GetBullyScreenLatest(bullyScreenServer.Id, activity.RehearsalId, activity.ArchId)
bully_reward_service.CheckBullyScreenStatus(server.Id)
result, err := bully_reward_service.GetBullyScreenLatest(server.Id, activity.RehearsalId, activity.ArchId)
t.CheckErr(err)
if result == nil || result.Id == 0 {
t.JSON(result)

2
controllers/pc/reward.go

@ -32,6 +32,8 @@ func (t *RewardCtl) Latest() {
t.CheckErr(err)
t.Assert(exist, code.MSG_REWARD_NOT_EXIST, "打赏不存在")
go bully_reward_service.CheckRewardStatus(server.Id)
result, err := bully_reward_service.GetRewardLatest(server.Id, activity.RehearsalId, activity.ArchId)
t.CheckErr(err)
if result == nil || result.Id == 0 {

2
go.mod

@ -5,7 +5,7 @@ go 1.12
require (
github.com/360EntSecGroup-Skylar/excelize/v2 v2.0.1
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53 // indirect
github.com/aws/aws-sdk-go v1.33.8 // indirect
github.com/aws/aws-sdk-go v1.33.9 // indirect
github.com/chanxuehong/wechat v0.0.0-20200409104612-0a1fd76d7a3a
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect

2
go.sum

@ -63,6 +63,8 @@ github.com/aws/aws-sdk-go v1.33.6 h1:YLoUeMSx05kHwhS+HLDSpdYYpPzJMyp6hn1cWsJ6a+U
github.com/aws/aws-sdk-go v1.33.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.33.8 h1:2/sOfb9oPHTRZ0lxinoaTPDcYwNa1H/SpKP4nVRBwmg=
github.com/aws/aws-sdk-go v1.33.8/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.33.9 h1:nkC8YxL1nxwshIoO3UM2486Ph+zs7IZWjhRHjmXeCPw=
github.com/aws/aws-sdk-go v1.33.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/bndr/gotabulate v1.1.2 h1:yC9izuZEphojb9r+KYL4W9IJKO/ceIO8HDwxMA24U4c=
github.com/bndr/gotabulate v1.1.2/go.mod h1:0+8yUgaPTtLRTjf49E8oju7ojpU11YmXyvq1LbPAb3U=

4
services/bully_reward/dao.go

@ -140,13 +140,13 @@ type BullyScreenStatus struct {
Order *models.UserOrder `json:"order" xorm:"extends"`
}
func CheckBullyScreenStatus(bullyScreenServerId int64) error {
func CheckBullyScreenStatus(serverId int64) error {
result := make([]*BullyScreenStatus, 0)
err := core.GetXormAuto().Table(new(models.BullyScreenHistory)).Alias("h").
Join("LEFT", new(models.UserOrder).AliasName("u"),
"u.out_trade_no=h.out_trade_no and u.is_delete=0").
Where("h.bully_screen_server_id=? and h.status=-1 and h.is_delete=0",
bullyScreenServerId).Find(&result)
serverId).Find(&result)
if err != nil {
return err
}

Loading…
Cancel
Save