Browse Source

彩排或者打赏不需审核

master
黄梓健 5 years ago
parent
commit
d9e61f701c
  1. 10
      controllers/client/lottery.go
  2. 10
      controllers/client/reward.go
  3. 12
      log/hdzj.log
  4. 1
      models/user_prize.go

10
controllers/client/lottery.go

@ -17,7 +17,8 @@ func (t *LotteryCtl) UserLotteries() {
uid := t.MustGetUID()
userPrizes := make([]*models.UserPrize, 0)
err := core.GetXormAuto().Where("is_delete=0 and user_id=? ", uid).Desc("created_at").Find(&userPrizes)
err := core.GetXormAuto().Where("is_delete=0 and user_id=? ", uid).
Desc("created_at").Find(&userPrizes)
t.CheckErr(err)
t.JSON(map[string]interface{}{
@ -27,12 +28,19 @@ func (t *LotteryCtl) UserLotteries() {
}
func (t *LotteryCtl) CashLottery() {
uid := t.MustGetUID()
prizeId := t.MustGetInt64("prize_id")
name := t.MustGet("name")
phone := t.MustGet("phone")
wxNo := t.MustGet("wx_no")
address := t.MustGet("address")
prize := new(models.UserPrize)
prize.Id = prizeId
prize.UserId = uid
prize.Status = 1
err := prize.Update("status")
t.CheckErr(err)
record := new(models.LotteryDrawRecord)
exist, err := record.GetByUserPrizeId(prizeId)
t.CheckErr(err)

10
controllers/client/reward.go

@ -62,7 +62,7 @@ func (t *RewardCtl) Reward() {
t.CheckErr(err)
}
_, err = core.GetXormAuto().InsertOne(&models.RewardHistory{
history := &models.RewardHistory{
OutTradeNo: res["out_trade_no"].(string),
ActivityId: activityId,
RewardServerId: rewardServer.Id,
@ -76,7 +76,13 @@ func (t *RewardCtl) Reward() {
IsDelete: false,
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
})
}
if _type == 1 || activity.RehearsalId != 0 { // 彩排或者直播不需要审核
history.Status = 0
}
_, err = core.GetXormAuto().InsertOne(history)
t.CheckErr(err)
res["rehearsal_id"] = activity.RehearsalId

12
log/hdzj.log

@ -76,3 +76,15 @@
2020-05-07 12:00:57.542 ERROR logger/logger.go:92 打赏状态发送变化: err->Params type error, out_trade_no GjpJb0V0iJ1Z3yOFJQJailW3boAUWbvF
2020-05-07 12:03:33.742 ERROR logger/logger.go:92 打赏状态发送变化: err->Params type error, out_trade_no GjpJb0V0iJ1Z3yOFJQJailW3boAUWbvF
2020-05-11 16:16:45.145 ERROR logger/logger.go:92 查询订单出现错误 {"错误原因": "<xml><return_code>FAIL</return_code><return_msg>当前使用此业务的用户过多,请稍后再试</return_msg></xml>", "交易订单号": "4gzTv4P1fqMOe2LsXCaKAeAxNX1ngnue"}
2020-05-18 13:47:38.941 ERROR logger/logger.go:87 user:===>%+v&{0 0 0 0 false 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC}
2020-05-18 13:47:38.951 ERROR logger/logger.go:87 token:==>%veyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBY2NvdW50VHlwZSI6Img1dXNlciIsIkFjY291bnRJZCI6MCwiQ3VzdG9tZXJJZCI6MCwiQ3VzdG9tZXJQaWQiOjAsIkFjdGl2aXR5SWQiOjAsIkFyZWFJZCI6MCwiYXVkIjoib3NtYW50aHVzd2luZS1hdWRpZW5jZS1veCIsImV4cCI6MTY3NjE3OTI5MSwianRpIjoiNDEzMGM3YjYtMDZkZi00Yjk4LWJjMDQtMDk3MzAwZjEyYzdhIiwiaXNzIjoib3NtYW50aHVzd2luZS1pc3N1ZXItb3giLCJzdWIiOiJvc21hbnRodXN3aW5lLXN1YmplY3Qtb3gifQ.uE1EBPVltVZm0i11h2Bq8E5p6WWgewYZWXOzL_2kNoA
2020-05-18 13:47:38.951 ERROR logger/logger.go:87 user_id:===>%v0
2020-05-18 13:51:04.335 ERROR logger/logger.go:87 user:===>%+v&{0 0 0 0 false 0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC}
2020-05-18 13:51:04.336 ERROR logger/logger.go:87 token:==>%veyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBY2NvdW50VHlwZSI6Img1dXNlciIsIkFjY291bnRJZCI6MCwiQ3VzdG9tZXJJZCI6MCwiQ3VzdG9tZXJQaWQiOjAsIkFjdGl2aXR5SWQiOjAsIkFyZWFJZCI6MCwiYXVkIjoib3NtYW50aHVzd2luZS1hdWRpZW5jZS1veCIsImV4cCI6MTY3NjE3OTI5MSwianRpIjoiNDEzMGM3YjYtMDZkZi00Yjk4LWJjMDQtMDk3MzAwZjEyYzdhIiwiaXNzIjoib3NtYW50aHVzd2luZS1pc3N1ZXItb3giLCJzdWIiOiJvc21hbnRodXN3aW5lLXN1YmplY3Qtb3gifQ.uE1EBPVltVZm0i11h2Bq8E5p6WWgewYZWXOzL_2kNoA
2020-05-18 13:51:04.336 ERROR logger/logger.go:87 user_id:===>%v0
2020-05-18 14:00:58.095 ERROR logger/logger.go:87 user:===>%+v&{1 阳江 广东 中国 oYJTvt9Pz9blsITPp1q9V8E9HoQs o9XM41s_NN8Y0QK6_MbM-aYMV3TE 疯狂疯狂@黄梓健 http://thirdwx.qlogo.cn/mmopen/vi_32/U8krFYdib9PITkDicbaNPnJHKpUMJ8unribzyPcUKWKGyJovoKmES6UHW1Zl6bVsUUtY7I404UNQXG7ll5rWy6Fmg/132 男 0 127 127 主会场 false 2020-05-18 13:37:14 +0800 CST 2020-05-18 13:37:40 +0800 CST}
2020-05-18 14:00:58.095 ERROR logger/logger.go:87 token:==>%veyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBY2NvdW50VHlwZSI6Img1dXNlciIsIkFjY291bnRJZCI6MSwiQ3VzdG9tZXJJZCI6MCwiQ3VzdG9tZXJQaWQiOjAsIkFjdGl2aXR5SWQiOjAsIkFyZWFJZCI6MCwiYXVkIjoib3NtYW50aHVzd2luZS1hdWRpZW5jZS1veCIsImV4cCI6MTY3NDU0ODE1NCwianRpIjoiMDkwNGY0ODItNTdkOC00NGNmLTg1MzEtYmFjMTk5ZjU1ZDdmIiwiaXNzIjoib3NtYW50aHVzd2luZS1pc3N1ZXItb3giLCJzdWIiOiJvc21hbnRodXN3aW5lLXN1YmplY3Qtb3gifQ.OVJtS0emjP4pkhR8hFGsUCJu6AicDSOh0IfPv27epKk
2020-05-18 14:00:58.095 ERROR logger/logger.go:87 user_id:===>%v1
2020-05-18 14:09:10.578 ERROR logger/logger.go:87 user:===>%+v&{1 阳江 广东 中国 oYJTvt9Pz9blsITPp1q9V8E9HoQs o9XM41s_NN8Y0QK6_MbM-aYMV3TE 疯狂疯狂@黄梓健 http://thirdwx.qlogo.cn/mmopen/vi_32/U8krFYdib9PITkDicbaNPnJHKpUMJ8unribzyPcUKWKGyJovoKmES6UHW1Zl6bVsUUtY7I404UNQXG7ll5rWy6Fmg/132 男 0 127 127 主会场 false 2020-05-18 13:37:14 +0800 CST 2020-05-18 13:37:40 +0800 CST}
2020-05-18 14:09:10.578 ERROR logger/logger.go:87 token:==>%veyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJBY2NvdW50VHlwZSI6Img1dXNlciIsIkFjY291bnRJZCI6MSwiQ3VzdG9tZXJJZCI6MCwiQ3VzdG9tZXJQaWQiOjAsIkFjdGl2aXR5SWQiOjAsIkFyZWFJZCI6MCwiYXVkIjoib3NtYW50aHVzd2luZS1hdWRpZW5jZS1veCIsImV4cCI6MTY3NDU0ODE1NCwianRpIjoiMDkwNGY0ODItNTdkOC00NGNmLTg1MzEtYmFjMTk5ZjU1ZDdmIiwiaXNzIjoib3NtYW50aHVzd2luZS1pc3N1ZXItb3giLCJzdWIiOiJvc21hbnRodXN3aW5lLXN1YmplY3Qtb3gifQ.OVJtS0emjP4pkhR8hFGsUCJu6AicDSOh0IfPv27epKk
2020-05-18 14:09:10.578 ERROR logger/logger.go:87 user_id:===>%v1

1
models/user_prize.go

@ -16,6 +16,7 @@ type UserPrize struct {
PrizeName string `json:"prize_name" xorm:"not null default('') comment('奖品名字') VARCHAR(128)"`
PrizeImg string `json:"prize_img" xorm:"not null default('') comment('奖品图片') VARCHAR(255)"`
PrizeType int `json:"prize_type" xorm:"not null default(0) comment('订单来源1普通抽奖2订单抽奖3订单送礼4直播下单') INT(11)"`
Status int `json:"status" xorm:"not null default 0 comment('是否已经兑奖0否1是') TINYINT(1)"`
IsDelete bool `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('更新时间') DATETIME"`

Loading…
Cancel
Save