Browse Source

fix:bug

token_replace
黄梓健 5 years ago
parent
commit
8584e3a0e0
  1. 4
      controllers/pc/bully_screen.go
  2. 5
      controllers/pc/reward.go
  3. 12
      models/lottery_draw_record.go
  4. 6
      services/bully_reward/dao.go

4
controllers/pc/bully_screen.go

@ -31,7 +31,7 @@ func (t *BullyScreenCtl) WaitReview() {
t.Assert(exist, code.MSG_BULLY_SCREEN_SERVER_NOT_EXIST, "霸屏不存在")
//根据霸屏服务得id获取待审核得霸屏列表
//t.CheckErr(bully_reward_service.CheckBullyScreenStatus(bullyScreenServer.Id))
go bully_reward_service.CheckBullyScreenStatus(bullyScreenServer.Id)
result, err := bully_reward_service.GetBullyScreenReview(bullyScreenServer.Id, activity.RehearsalId, activity.ArchId)
t.CheckErr(err)
@ -164,8 +164,6 @@ func (t *BullyScreenCtl) Latest() {
t.CheckErr(err)
t.Assert(exist, code.MSG_BULLY_SCREEN_SERVER_NOT_EXIST, "霸屏不存在")
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 {

5
controllers/pc/reward.go

@ -32,8 +32,6 @@ 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 {
@ -55,7 +53,6 @@ func (t *RewardCtl) Latest() {
//获取待审核列表
func (t *RewardCtl) WaitReview() {
activityId := t.MustGetInt64("activity_id")
//rehearsalId := t.MustGetInt64("rehearsal_id")
activity := &models.Activity{}
exist, err := models.Get(activity, activityId)
@ -69,7 +66,7 @@ func (t *RewardCtl) WaitReview() {
t.Assert(exist, code.MSG_REWARD_NOT_EXIST, "打赏不存在")
//// todo: 检查订单
//t.CheckErr(bully_reward_service.CheckRewardStatus(server.Id))
go bully_reward_service.CheckRewardStatus(server.Id, activity.ArchId)
result, err := bully_reward_service.GetRewardReview(server.Id, activity.RehearsalId, activity.ArchId)
t.CheckErr(err)

12
models/lottery_draw_record.go

@ -55,18 +55,6 @@ func (t *LotteryDrawRecord) GetByUserPrizeId(upId int64) (bool, error) {
return core.GetXormAuto().Where("is_delete=0 and user_prize_id=?", upId).Get(t)
}
func GetLotteryUsersResultByLotteryDrawRecord(obj, ladderId, rehearsalId interface{}, rollNum int) error {
session := core.GetXormAuto().Table(new(LotteryDrawRecord)).Alias("r").
Join("LEFT", new(User).Alias("u"), "u.id=r.user_id").
Where("r.is_delete=0 and r.lottery_draw_rule_ladder_id=? and "+
"r.rehearsal_id=?", ladderId, rehearsalId)
defer session.Close()
if rollNum > 0 {
session = session.Where("roll_num=?", rollNum)
}
return session.Find(&obj)
}
func GetUserIdsByLotteryDrawRuleId(ruleId, rehearsalId, areaId, archId interface{}) ([]int64, error) {
recordIds := make([]int64, 0)
err := core.GetXormAuto().Table(new(LotteryDrawRecord)).Select("user_id").

6
services/bully_reward/dao.go

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

Loading…
Cancel
Save