DengBiao 1 vuosi sitten
vanhempi
commit
5c3d209c7b
2 muutettua tiedostoa jossa 38 lisäystä ja 35 poistoa
  1. +3
    -1
      consume/dou_shen_user_register_for_official_consume.go
  2. +35
    -34
      consume/dou_shen_user_register_for_operation_center.go

+ 3
- 1
consume/dou_shen_user_register_for_official_consume.go Näytä tiedosto

@@ -121,6 +121,9 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error {
return err
}
for _, group := range *officialGroups {
if officialGroup != nil {
continue
}
//统计当前群有多少人
userGroups, _ := db2.GroupUserFindByParams(db.ImDb, map[string]interface{}{
"key": "group_id",
@@ -128,7 +131,6 @@ func handleDouShenUserRegisterConsumeForOfficial(msgData []byte) error {
})
if len(*userGroups) < 500 {
officialGroup = &group
break
}
}



+ 35
- 34
consume/dou_shen_user_register_for_operation_center.go Näytä tiedosto

@@ -6,6 +6,7 @@ import (
db2 "applet/app/db/gim"
"applet/app/db/gim/model"
model2 "applet/app/db/model"
"applet/app/svc"
utils2 "applet/app/utils"
"applet/app/utils/logx"
utils "applet/app/utils/rpc"
@@ -212,40 +213,40 @@ func handleDouShenUserRegisterConsumeForOperationCenter(msgData []byte) error {
})

//发送专属红包
//gimSendSpeciallyRedPackageUser, err := db2.DbSysCfg.SysCfgGetOne("send_specially_red_package_user", msg.MasterId)
//if err != nil {
// return err
//}
//if gimSendSpeciallyRedPackageUser == nil {
// return errors.New("暂未设置专属红包发送用户")
//}
//sendSpeciallyRedPackageUser, err := db.SysCfgGetOne(db.DBs[msg.MasterId], "send_specially_red_package_user")
//if err != nil {
// return err
//}
//amount, err := getSendAmount(msg.MasterId)
//if err != nil {
// return err
//}
//args := md.SendRedPackageReq{
// UserId: gimSendSpeciallyRedPackageUser.Val,
// DeviceId: "",
// Token: "",
// Amount: amount,
// RedPacketType: 5,
// RedPacketNums: 1,
// RedPacketContent: "抖省赚钱,大吉大利",
// RedPacketSmallContent: gimUser.Nickname + "的专属红包",
// ReceiverType: 2,
// ReceiverId: int64(OperationGroup.GroupId),
// SendTime: utils2.UnixMilliTime(time.Now()),
// ToUserIds: []int64{gimUser.Id},
// RedPackageCover: "",
//}
//err, _ = svc.CurlSendRedPackage(args, msg.MasterId, sendSpeciallyRedPackageUser.Val)
//if err != nil {
// return err
//}
gimSendSpeciallyRedPackageUser, err := db2.DbSysCfg.SysCfgGetOne("send_specially_red_package_user", msg.MasterId)
if err != nil {
return err
}
if gimSendSpeciallyRedPackageUser == nil {
return errors.New("暂未设置专属红包发送用户")
}
sendSpeciallyRedPackageUser, err := db.SysCfgGetOne(db.DBs[msg.MasterId], "send_specially_red_package_user")
if err != nil {
return err
}
amount, err := getSendAmount(msg.MasterId)
if err != nil {
return err
}
args := md.SendRedPackageReq{
UserId: gimSendSpeciallyRedPackageUser.Val,
DeviceId: "",
Token: "",
Amount: amount,
RedPacketType: 5,
RedPacketNums: 1,
RedPacketContent: "抖省赚钱,大吉大利",
RedPacketSmallContent: gimUser.Nickname + "的专属红包",
ReceiverType: 2,
ReceiverId: int64(OperationGroup.GroupId),
SendTime: utils2.UnixMilliTime(time.Now()),
ToUserIds: []int64{gimUser.Id},
RedPackageCover: "",
}
err, _ = svc.CurlSendRedPackage(args, msg.MasterId, sendSpeciallyRedPackageUser.Val)
if err != nil {
return err
}
return nil
}



Ladataan…
Peruuta
Tallenna