|
|
@@ -2,9 +2,12 @@ package consume |
|
|
|
|
|
|
|
import ( |
|
|
|
"applet/app/cfg" |
|
|
|
"applet/app/db" |
|
|
|
utils2 "applet/app/utils" |
|
|
|
"applet/app/utils/logx" |
|
|
|
"applet/consume/md" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_system_rules.git" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy" |
|
|
|
md2 "code.fnuoos.com/EggPlanet/egg_system_rules.git/rule/egg_energy/md" |
|
|
@@ -68,5 +71,32 @@ func handleEggEnergyNewUserRegisterDataConsume(msgData []byte) error { |
|
|
|
return err |
|
|
|
} |
|
|
|
|
|
|
|
// 3. 更新新增人数 |
|
|
|
now := time.Now().Format("2006-01-02") |
|
|
|
growDataDb := implement.NewPlatformGrowDataDb(db.Db) |
|
|
|
growData, err := growDataDb.PlatformGrowDataGetOneByParams(map[string]interface{}{ |
|
|
|
"key": "date", |
|
|
|
"value": now, |
|
|
|
}) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
if growData != nil { |
|
|
|
growData.UserGrowCount++ |
|
|
|
_, err = growDataDb.PlatformGrowDataUpdate(growData, "user_grow_count") |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
} else { |
|
|
|
m := model.PlatformGrowData{ |
|
|
|
UserGrowCount: 1, |
|
|
|
Date: now, |
|
|
|
} |
|
|
|
_, err = growDataDb.PlatformGrowDataInsert(&m) |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return nil |
|
|
|
} |