Sfoglia il codice sorgente

add reverse:for v1.0.5 test

tags/v1.0.5
huangjiajun 2 anni fa
parent
commit
061050957f
2 ha cambiato i file con 7 aggiunte e 11 eliminazioni
  1. +0
    -5
      go.mod
  2. +7
    -6
      o2o/add_store_commission.go

+ 0
- 5
go.mod Vedi File

@@ -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


+ 7
- 6
o2o/add_store_commission.go Vedi File

@@ -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


Caricamento…
Annulla
Salva