Browse Source

update

master
dengbiao 2 weeks ago
parent
commit
58a5f623d3
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      rule/egg_energy/activity_coin_ready_exchange_egg_energy.go

+ 13
- 1
rule/egg_energy/activity_coin_ready_exchange_egg_energy.go View File

@@ -16,6 +16,18 @@ import (

// ActivityCoinReadyExchangeEggEnergy 蛋蛋积分【准备】兑换成蛋蛋能量
func ActivityCoinReadyExchangeEggEnergy(engine *xorm.Engine, uid int64, ch *rabbit.Channel) (err error) {
//TODO::判断是否存在正在签到记录
var eggSignIn model.EggSignIn
has, err := engine.Where("uid = ? and is_completed =?", uid, 0).
Get(&eggSignIn)
if err != nil {
return
}
if has {
err = errors.New("重复签到~~~")
return
}

//1、查找`egg_energy_basic_setting` 基础设置
eggEnergyBasicSettingDb := implement.NewEggEnergyBasicSettingDb(engine)
eggEnergyBasicSetting, err := eggEnergyBasicSettingDb.EggEnergyBasicSettingGetOneByParams(map[string]interface{}{
@@ -123,7 +135,7 @@ func ActivityCoinReadyExchangeEggEnergy(engine *xorm.Engine, uid int64, ch *rabb

//7、新增 `egg_energy_user_activity` 记录
var m model.EggEnergyUserActivity
has, err := engine.Where("uid =? and date =?", uid, now.Format("2006-01-02")).Get(&m)
has, err = engine.Where("uid =? and date =?", uid, now.Format("2006-01-02")).Get(&m)
if err != nil {
return err
}


Loading…
Cancel
Save