|
|
@@ -203,10 +203,12 @@ func (s *ServiceDataAbnormalRate) SyncAbnormalRateByBatch() {
|
|
|
}
|
|
|
xjfJson, err := simplejson.NewJson(dataXjf)
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
xjfArr, err := xjfJson.Array()
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
//查询微信扫码订单数
|
|
|
@@ -229,15 +231,20 @@ func (s *ServiceDataAbnormalRate) SyncAbnormalRateByBatch() {
|
|
|
if string(result) != "null" {
|
|
|
dataJson, err := simplejson.NewJson(result)
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
dataArr, err := dataJson.Array()
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
for iii, _ := range dataArr {
|
|
|
info := dataJson.GetIndex(iii)
|
|
|
gameId, _ := info.Get("game_id").Int()
|
|
|
+ if gameId == 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
total, _ := info.Get("total").Int()
|
|
|
//var arr = XjfTotal{GameId: gameId, Total: total}
|
|
|
//arrTemp = append(arrTemp, arr)
|
|
|
@@ -262,21 +269,33 @@ func (s *ServiceDataAbnormalRate) SyncAbnormalRateByBatch() {
|
|
|
}
|
|
|
dataJson, err := simplejson.NewJson(result)
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
dataArr, err := dataJson.Array()
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
arrTemp := make(map[int]int)
|
|
|
for iii, _ := range dataArr {
|
|
|
info := dataJson.GetIndex(iii)
|
|
|
gameId, err := info.Get("game_id").Int()
|
|
|
+ global.GVA_LOG.Info(strconv.Itoa(gameId))
|
|
|
+ if gameId == 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error(err.Error())
|
|
|
return
|
|
|
}
|
|
|
total, err := info.Get("total").Int()
|
|
|
+ global.GVA_LOG.Info(strconv.Itoa(total))
|
|
|
+ if total == 0 && err != nil {
|
|
|
+ continue
|
|
|
+ }
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error(err.Error())
|
|
|
return
|
|
|
}
|
|
|
//global.GVA_LOG.Info(strconv.Itoa(gameId))
|
|
|
@@ -364,11 +383,13 @@ func (s *ServiceDataAbnormalRate) SyncAbnormalRateByBatch() {
|
|
|
info := xjfJson.GetIndex(iii)
|
|
|
gameId, err := info.Get("game_id").Int()
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
if gameId == task.TaskId {
|
|
|
orderSuccessRate, err = info.Get("order_success_rate").String()
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
break
|
|
|
@@ -379,6 +400,7 @@ func (s *ServiceDataAbnormalRate) SyncAbnormalRateByBatch() {
|
|
|
numOrderPay, err = strconv.Atoi(orderSuccessRateArr[0]) // 付费订单数
|
|
|
numPay, err = strconv.Atoi(orderSuccessRateArr[1]) // 付费成功数
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
ratePaySuccess = orderSuccessRateArr[2] //付费成功率
|
|
|
@@ -418,6 +440,7 @@ func (s *ServiceDataAbnormalRate) SyncAbnormalRateByBatch() {
|
|
|
//global.GVA_LOG.Info("已存在,更新")
|
|
|
err = global.GVA_DB.Model(&dataStatistics.DataAbnormalRate{}).Where("new_date = ? and task_id = ? and hour = ?", newDate, taskId, hour).Updates(data).Error
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
} else {
|
|
|
@@ -425,6 +448,7 @@ func (s *ServiceDataAbnormalRate) SyncAbnormalRateByBatch() {
|
|
|
//global.GVA_LOG.Info("不存在,新建")
|
|
|
err = global.GVA_DB.Create(&data).Error
|
|
|
if err != nil {
|
|
|
+ global.GVA_LOG.Error("Error", zap.Error(err))
|
|
|
return
|
|
|
}
|
|
|
}
|