Browse Source

fix:bug

token_replace
黄梓健 4 years ago
parent
commit
7b6a8182c2
  1. 5
      controllers/pc/lottery_draw.go
  2. 1
      controllers/pc/reward.go
  3. 2
      controllers/pc/shake_red_envelope.go
  4. 20
      services/pay/handle.go

5
controllers/pc/lottery_draw.go

@ -63,6 +63,7 @@ func (t *LotteryDrawCtl) Start() {
if exist && live.HaveModule(define.MODULE_LOTTERY) {
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStart,
map[string]interface{}{
"admin": 1,
"lottery_draw_ladder_id": ladder.Id,
"timestamp": time.Now().Unix(),
"desc": "开始抽奖",
@ -104,6 +105,7 @@ func (t *LotteryDrawCtl) StartRoll() {
if exist && live.HaveModule(define.MODULE_LOTTERY) {
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStart,
map[string]interface{}{
"admin": 1,
"lottery_draw_ladder_id": ladder.Id,
"timestamp": time.Now().Unix(),
"roll_num": ladder.RollNum,
@ -139,6 +141,7 @@ func (t *LotteryDrawCtl) StopRoll() {
if exist && live.HaveModule(define.MODULE_LOTTERY) {
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawRollStop,
map[string]interface{}{
"admin": 1,
"lottery_draw_ladder_id": ladder.Id,
"timestamp": time.Now().Unix(),
"roll_num": ladder.RollNum,
@ -180,6 +183,7 @@ func (t *LotteryDrawCtl) Stop() {
if exist && live.HaveModule(define.MODULE_LOTTERY) {
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawStop,
map[string]interface{}{
"admin": 1,
"lottery_draw_ladder_id": ladder.Id,
"timestamp": time.Now().Unix(),
"desc": "结束抽奖",
@ -374,6 +378,7 @@ func (t *LotteryDrawCtl) Lottery() {
if exist && live.HaveModule(define.MODULE_LOTTERY) {
go im_service.SendGroupCustomMessage("admin", activityId, im_service.NoticeLotteryDrawResult,
map[string]interface{}{
"admin": 1,
"lottery_draw_ladder_id": ladder.Id,
"winners": winners,
"roll_num": ladder.RollNum,

1
controllers/pc/reward.go

@ -113,6 +113,7 @@ func (t *RewardCtl) Review() {
go im_service.SendGroupCustomMessage(v.UserId, v.ActivityId, im_service.NoticeReward,
map[string]interface{}{
"admin": 1,
"amount": v.Amount,
"content": v.Content,
})

2
controllers/pc/shake_red_envelope.go

@ -93,6 +93,7 @@ func (t *ShakeRedEnvelopeCtl) Start() {
if exist && live.HaveModule(define.MODULE_SHAKRB) {
go im_service.SendGroupCustomMessage("admin", envelope.ActivityId, im_service.NoticeShakeRedPackStart,
map[string]interface{}{
"admin": 1,
"customer_id": uid,
"shake_red_envelope_rule_id": rule.Id,
"timestamp": time.Now().Unix(),
@ -135,6 +136,7 @@ func (t *ShakeRedEnvelopeCtl) Stop() {
if exist && live.HaveModule(define.MODULE_SHAKRB) {
go im_service.SendGroupCustomMessage("admin", envelope.ActivityId, im_service.NoticeShakeRedPackEnd,
map[string]interface{}{
"admin": 1,
"customer_id": uid,
"shake_red_envelope_rule_id": rule.Id,
"timestamp": time.Now().Unix(),

20
services/pay/handle.go

@ -45,12 +45,7 @@ func HandleSuccess(order *models.UserOrder) error {
return errors.New("订单状态异常")
}
//subs := make([]map[string]string, 0)
subs, err := models.GetCustomerOrderSubsByOrderId(cOrder.Id)
//err = core.GetXormAuto().Table(new(models.CustomerOrderSub)).Alias("s").
// Select("s.order_no, s.goods_id, s.goods_num, s.good_name, s.good_price, g.goods_pic_url").
// Join("left", new(models.CustomerGoods).Alias("g"), "g.id=s.goods_id").
// Where("s.is_delete=0 and s.order_=?", cOrder.Id).Find(&subs)
if err != nil {
s.Rollback()
return err
@ -116,8 +111,15 @@ func HandleSuccess(order *models.UserOrder) error {
return err
}
for _, sub := range subs {
go im_service.SendGroupCustomMessage(cOrder.BuyerId, order.ActivityId, im_service.NoticeLiveGoodBuy,
area := models.AreaStore{}
exist, _ := area.GetByUserId(cOrder.ActivityId, cOrder.BuyerId)
admin := 0
if exist {
admin = 1
}
go im_service.SendGroupCustomMessage(cOrder.BuyerId, cOrder.ActivityId, im_service.NoticeLiveGoodBuy,
map[string]interface{}{
"admin": admin,
"goods_pic_url": sub["goods_pic_url"],
"goods_num": sub["goods_num"],
"good_name": sub["good_name"],
@ -137,8 +139,14 @@ func HandleSuccess(order *models.UserOrder) error {
return errors.New("订单状态异常")
}
exist, _ = new(models.AreaStore).GetByUserId(info.ActivityId, info.UserId)
admin := 0
if exist {
admin = 1
}
go im_service.SendGroupCustomMessage(info.UserId, order.ActivityId, im_service.NoticeLiveRedPackStart,
map[string]interface{}{
"admin": 1,
"live_red_envelope_rule_id": info.Id,
"prompt": info.Prompt,
"timestamp": time.Now().Unix(),

Loading…
Cancel
Save