Browse Source

update

master
DengBiao 10 months ago
parent
commit
96f2e40e75
2 changed files with 33 additions and 1 deletions
  1. +1
    -1
      rule/one_circles/one_circles_public_platoon_give_activty_coin.go
  2. +32
    -0
      rule/public_platoon_double_network_relate_commission.go

+ 1
- 1
rule/one_circles/one_circles_public_platoon_give_activty_coin.go View File

@@ -92,7 +92,7 @@ func SettlementPublicGiveActivityCoin(engine *xorm.Engine, masterId string, uid
}
//判断是否活跃
var m model.OneCirclesGreenEnergySignIn
has, err3 := engine.Where("uid =?", fatherUid).And("end_time <=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m)
has, err3 := engine.Where("uid =?", fatherUid).And("end_time >=?", time.Now().Format("2006-01-02 15:04:05")).Get(&m)
if err != nil {
return err3
}


+ 32
- 0
rule/public_platoon_double_network_relate_commission.go View File

@@ -426,3 +426,35 @@ func GetUserRankAmount(engine *xorm.Engine, rank string) (amount string, err err
}
return
}

func ResetPublicPlatoonDoubleNetwork(engine *xorm.Engine, dbName string) (err error) {
//1、查找 `user_public_platoon_setting` 基础设置
now := time.Now()
userPublicPlatoonDoubleNetworkSetting, err := db.UserPublicPlatoonDoubleNetworkSettingGetOneByParams(engine, map[string]interface{}{
"key": "is_open",
"value": 1,
})
if err != nil {
return err
}
if userPublicPlatoonDoubleNetworkSetting.IsOpen != 1 {
return errors.New("未开启公排双网!")
}
if userPublicPlatoonDoubleNetworkSetting.SettlementDate != now.Format("2006-01-02") {
return errors.New("非重置日期!")
}

//2、计算排名数据
//sql := "SELECT id, uid, amount, @rank := @rank + 1 AS rank FROM `user_public_platoon_double_network_user_coin_record`, (SELECT @rank:=0) r ORDER BY amount DESC;"
//nativeString, _ := db.QueryNativeString(engine, sql)
//if len(nativeString) <= 0 {
// return errors.New("当前无排名数据")
//}
//for _, v := range nativeString {
// if rank == v["rank"] {
// amount = v["amount"]
// break
// }
//}
return
}

Loading…
Cancel
Save