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