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