Browse Source

add reverse:for v1.0.5 test

tags/v1.0.5
huangjiajun 2 years ago
parent
commit
061050957f
2 changed files with 7 additions and 11 deletions
  1. +0
    -5
      go.mod
  2. +7
    -6
      o2o/add_store_commission.go

+ 0
- 5
go.mod View File

@@ -3,14 +3,9 @@ module code.fnuoos.com/go_rely_warehouse/zyos_go_o2o_business.git
go 1.15 go 1.15


require ( require (
github.com/gin-gonic/gin v1.8.0
github.com/go-redis/redis v6.15.9+incompatible github.com/go-redis/redis v6.15.9+incompatible
github.com/go-sql-driver/mysql v1.6.0 github.com/go-sql-driver/mysql v1.6.0
github.com/gomodule/redigo v1.8.8 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 go.uber.org/zap v1.16.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0
xorm.io/builder v0.3.10 // indirect xorm.io/builder v0.3.10 // indirect


+ 7
- 6
o2o/add_store_commission.go View File

@@ -19,6 +19,10 @@ oid 订单号
pvd 渠道 pvd 渠道
*/ */
func AddStoreCommission(eg *xorm.Engine, args map[string]string) { 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"]) user, err := db.UserProfileFindByID(eg, args["uid"])
if err != nil || user == nil { if err != nil || user == nil {
return return
@@ -36,10 +40,7 @@ func AddStoreCommission(eg *xorm.Engine, args map[string]string) {
if relate != nil { if relate != nil {
return return
} }
amount := zhios_o2o_business_utils.StrToFloat64(args["commission"]) * zhios_o2o_business_utils.StrToFloat64(args["bili"])
if amount == 0 {
return
}

var ord = model.StoreCommissionRelate{ var ord = model.StoreCommissionRelate{
Uid: user.ParentUid, Uid: user.ParentUid,
FormUid: user.Uid, FormUid: user.Uid,
@@ -75,7 +76,7 @@ func SettleStoreCommission(eg *xorm.Engine, session *xorm.Session, args map[stri
if manager == nil { if manager == nil {
return true 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) amount := zhios_o2o_business_utils.StrToFloat64(relate.Amount)
mBeforeAmount := merchant.Amount mBeforeAmount := merchant.Amount
mAfterAmount := mBeforeAmount + amount mAfterAmount := mBeforeAmount + amount
@@ -136,7 +137,7 @@ func DeductStoreCommission(eg *xorm.Engine, session *xorm.Session, args map[stri
if manager == nil { if manager == nil {
return true 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) amount := zhios_o2o_business_utils.StrToFloat64(relate.Amount)
mBeforeAmount := merchant.Amount mBeforeAmount := merchant.Amount
mAfterAmount := mBeforeAmount - amount mAfterAmount := mBeforeAmount - amount


Loading…
Cancel
Save