diff --git a/go.mod b/go.mod index 1b3b91b..21be11f 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,9 @@ module code.fnuoos.com/go_rely_warehouse/zyos_go_o2o_business.git go 1.15 require ( - github.com/gin-gonic/gin v1.8.0 github.com/go-redis/redis v6.15.9+incompatible github.com/go-sql-driver/mysql v1.6.0 github.com/gomodule/redigo v1.8.8 - github.com/iGoogle-ink/gopay v1.5.36 - github.com/iGoogle-ink/gotil v1.0.20 - github.com/pkg/errors v0.9.1 - github.com/syyongx/php2go v0.9.6 go.uber.org/zap v1.16.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0 xorm.io/builder v0.3.10 // indirect diff --git a/o2o/add_store_commission.go b/o2o/add_store_commission.go index 8361a34..8201ec1 100644 --- a/o2o/add_store_commission.go +++ b/o2o/add_store_commission.go @@ -19,6 +19,10 @@ oid 订单号 pvd 渠道 */ func AddStoreCommission(eg *xorm.Engine, args map[string]string) { + amount := zhios_o2o_business_utils.StrToFloat64(args["commission"]) * zhios_o2o_business_utils.StrToFloat64(args["bili"]) + if amount == 0 { + return + } user, err := db.UserProfileFindByID(eg, args["uid"]) if err != nil || user == nil { return @@ -36,10 +40,7 @@ func AddStoreCommission(eg *xorm.Engine, args map[string]string) { if relate != nil { return } - amount := zhios_o2o_business_utils.StrToFloat64(args["commission"]) * zhios_o2o_business_utils.StrToFloat64(args["bili"]) - if amount == 0 { - return - } + var ord = model.StoreCommissionRelate{ Uid: user.ParentUid, FormUid: user.Uid, @@ -75,7 +76,7 @@ func SettleStoreCommission(eg *xorm.Engine, session *xorm.Session, args map[stri if manager == nil { return true } - if manager.Id > 0 { + if manager.Id > 0 && zhios_o2o_business_utils.StrToFloat64(relate.Amount) > 0 { amount := zhios_o2o_business_utils.StrToFloat64(relate.Amount) mBeforeAmount := merchant.Amount mAfterAmount := mBeforeAmount + amount @@ -136,7 +137,7 @@ func DeductStoreCommission(eg *xorm.Engine, session *xorm.Session, args map[stri if manager == nil { return true } - if manager.Id > 0 { + if manager.Id > 0 && zhios_o2o_business_utils.StrToFloat64(relate.Amount) > 0 { amount := zhios_o2o_business_utils.StrToFloat64(relate.Amount) mBeforeAmount := merchant.Amount mAfterAmount := mBeforeAmount - amount