From 82a5772c0fddca4126f19c580e86f1180c6eb2c4 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 26 Jul 2024 16:33:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- consume/canal_guide_order_for_statistics.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/consume/canal_guide_order_for_statistics.go b/consume/canal_guide_order_for_statistics.go index fb6e3b1..60ee7d5 100644 --- a/consume/canal_guide_order_for_statistics.go +++ b/consume/canal_guide_order_for_statistics.go @@ -70,14 +70,14 @@ func CanalGuideOrderForStatisticsDetail(msg []byte, geoIp2db *geoip2.DBReader) e for _, data := range canalMsg.Data { if utils.StrToInt(data.PvdSettleAt) > 0 && strings.Contains(data.Ext, "pvd_settle_at") == false { - err = comm(sess, data.OrdId, data.BenefitAll, "pvd_settle", data.PvdSettleAt, data.Pvd) + err = comm(sess, data.OrdId, data.BenefitAll, "pvd_settle_at", data.PvdSettleAt, data.Pvd) if err != nil { sess.Rollback() return err } } - if utils.StrToInt(data.SettleAt) > 0 && strings.Contains(data.Ext, "settle_at") == false { - err = comm(sess, data.OrdId, data.BenefitAll, "settle", data.SettleAt, data.Pvd) + if utils.StrToInt(data.SettleAt) > 0 && strings.Contains(data.Ext, "station_settle_at") == false { + err = comm(sess, data.OrdId, data.BenefitAll, "station_settle_at", data.SettleAt, data.Pvd) if err != nil { sess.Rollback() return err @@ -93,10 +93,10 @@ func comm(sess *xorm.Session, oid, commission, types, times, pvd string) error { if byOid == nil { return nil } - if strings.Contains(byOid.Ext, "settle") && types == "settle" { + if strings.Contains(byOid.Ext, "station_settle_at") && types == "station_settle_at" { return nil } - if strings.Contains(byOid.Ext, "pvd_settle") && types == "pvd_settle" { + if strings.Contains(byOid.Ext, "pvd_settle_at") && types == "pvd_settle_at" { return nil } extData := make(map[string]interface{}) @@ -121,7 +121,7 @@ func comm(sess *xorm.Session, oid, commission, types, times, pvd string) error { return err } } - if types == "settle" { + if types == "station_settle_at" { sql := `select sum(amount) as amount from ord_list_relate where oid=%s ` sql = fmt.Sprintf(sql, oid) data, _ := db.QueryNativeStringWithSession(sess, sql) @@ -129,7 +129,7 @@ func comm(sess *xorm.Session, oid, commission, types, times, pvd string) error { total.StationSettleAmount = utils.Float64ToStrByPrec(utils.StrToFloat64(total.StationSettleAmount)+utils.StrToFloat64(data[0]["amount"]), 6) } } - if types == "pvd_settle" { + if types == "pvd_settle_at" { total.UnionSettleAmount = utils.Float64ToStrByPrec(utils.StrToFloat64(total.UnionSettleAmount)+utils.StrToFloat64(commission), 6) } _, err := sess.Where("id=?", total.Id).Update(total)