Browse Source

打赏和霸屏

master
黄梓健 5 years ago
parent
commit
b929e5e82d
  1. 18
      controllers/pc/bully_screen.go
  2. 11
      controllers/pc/reward.go
  3. 10
      models/real_sign_history.go

18
controllers/pc/bully_screen.go

@ -46,14 +46,13 @@ func (t *BullyScreenCtl) Review() {
customerId := t.MustGetUID() customerId := t.MustGetUID()
status := t.MustGetBool("status") status := t.MustGetBool("status")
ids := strings.Split(t.MustGet("ids"), "|") ids := strings.Split(t.MustGet("ids"), "|")
//activityId := t.MustGetInt64("activity_id")
rehearsalId := t.MustGetInt64("rehearsal_id")
activityId := t.MustGetInt64("activity_id")
//rehearsalId := t.MustGetInt64("rehearsal_id")
//// TODO: new feat
//activity := new(models.Activity)
//exist, err := models.Get(activity, activityId)
//t.CheckErr(err)
//t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在")
activity := new(models.Activity)
exist, err := models.Get(activity, activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在")
//将金额退回给用户 //将金额退回给用户
result, err := models.GetBullyScreenHistoryByIds(ids) result, err := models.GetBullyScreenHistoryByIds(ids)
@ -65,7 +64,7 @@ func (t *BullyScreenCtl) Review() {
_, err = models.Update(v.Id, v, "status") _, err = models.Update(v.Id, v, "status")
t.CheckErr(err) t.CheckErr(err)
if rehearsalId != 0 { // 彩排
if activity.RehearsalId != 0 { // 彩排
continue continue
} }
@ -75,7 +74,8 @@ func (t *BullyScreenCtl) Review() {
v.Status = 2 v.Status = 2
_, err = models.Update(v.Id, v, "status") _, err = models.Update(v.Id, v, "status")
t.CheckErr(err) t.CheckErr(err)
if rehearsalId != 0 {
if activity.RehearsalId != 0 {
continue continue
} }
// 订单宣告完成 // 订单宣告完成

11
controllers/pc/reward.go

@ -74,9 +74,14 @@ func (t *RewardCtl) WaitReview() {
func (t *RewardCtl) Review() { func (t *RewardCtl) Review() {
status := t.MustGetBool("status") status := t.MustGetBool("status")
ids := strings.Split(t.MustGet("ids"), "|") ids := strings.Split(t.MustGet("ids"), "|")
rehearsalId := t.MustGetInt64("rehearsal_id")
activityId := t.MustGetInt64("activity")
uid := t.MustGetUID() uid := t.MustGetUID()
activity := new(models.Activity)
exist, err := models.Get(activity, activityId)
t.CheckErr(err)
t.Assert(exist, code.MSG_ACTIVITY_NOT_EXIST, "互动不存在")
result, err := models.GetRewardHistoryByIds(ids) result, err := models.GetRewardHistoryByIds(ids)
t.CheckErr(err) t.CheckErr(err)
@ -87,7 +92,7 @@ func (t *RewardCtl) Review() {
_, err = models.Update(v.Id, v, "status") _, err = models.Update(v.Id, v, "status")
t.CheckErr(err) t.CheckErr(err)
if rehearsalId != 0 { // 彩排不需要金额
if activity.RehearsalId != 0 { // 彩排不需要金额
continue continue
} }
@ -100,7 +105,7 @@ func (t *RewardCtl) Review() {
_, err = models.Update(v.Id, v, "status") _, err = models.Update(v.Id, v, "status")
t.CheckErr(err) t.CheckErr(err)
if rehearsalId != 0 && v.Type == 0 { // 线下h5彩排不需要金额
if activity.RehearsalId != 0 && v.Type == 0 { // 线下h5彩排不需要金额
continue continue
} }

10
models/real_sign_history.go

@ -1,8 +1,9 @@
package models package models
import ( import (
"github.com/ouxuanserver/osmanthuswine/src/core"
"time" "time"
"github.com/ouxuanserver/osmanthuswine/src/core"
) )
const RealSignHistoryTN = TableNamePrefix + "real_sign_history" const RealSignHistoryTN = TableNamePrefix + "real_sign_history"
@ -34,12 +35,11 @@ func (t *RealSignHistory) Check(uid, aid, rid int64) (bool, error) {
uid, aid, rid).Get(t) uid, aid, rid).Get(t)
} }
func (t *RealSignHistory) UpdateById(ids []interface{}, fields ...string) (err error) {
func (t *RealSignHistory) UpdateById(ids interface{}, fields ...string) (err error) {
if len(fields) > 0 { if len(fields) > 0 {
_, err = core.GetXormAuto().In("id", ids...).Cols(fields...).Update(t)
_, err = core.GetXormAuto().In("id", ids).Cols(fields...).Update(t)
} else { } else {
_, err = core.GetXormAuto().In("id", ids...).AllCols().Update(t)
_, err = core.GetXormAuto().In("id", ids).AllCols().Update(t)
} }
return err return err
} }

Loading…
Cancel
Save