Переглянути джерело

Merge remote-tracking branch 'origin/master'

three
huangjiajun 1 рік тому
джерело
коміт
cda0363696
3 змінених файлів з 40 додано та 39 видалено
  1. +1
    -1
      consume/dou_shen_user_register_for_my_my_recommender.go
  2. +4
    -4
      consume/dou_shen_user_register_for_official_consume.go
  3. +35
    -34
      consume/dou_shen_user_register_for_operation_center.go

+ 1
- 1
consume/dou_shen_user_register_for_my_my_recommender.go Переглянути файл

@@ -159,7 +159,7 @@ func handleDouShenUserRegisterConsumeForMyRecommender(msgData []byte) error {
//插入 dou_shen_im_group 记录
now := time.Now()
_, err = db.DouShenImGroupInsert(db.Db, &model2.DouShenImGroup{
Kind: 1,
Kind: 3,
Uid: int(msg.RecommenderUid),
GroupId: int(resp.GroupId),
IsFull: 0,


+ 4
- 4
consume/dou_shen_user_register_for_official_consume.go Переглянути файл

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


+ 35
- 34
consume/dou_shen_user_register_for_operation_center.go Переглянути файл

@@ -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
}



Завантаження…
Відмінити
Зберегти