@@ -13,6 +13,7 @@ type OrdList struct { | |||||
ItemCommissionRate float64 `xorm:"not null default 0.00 DOUBLE(6,4)" json:"item_commission_rate"` | ItemCommissionRate float64 `xorm:"not null default 0.00 DOUBLE(6,4)" json:"item_commission_rate"` | ||||
PaidPrice float64 `xorm:"not null default 0.00 DOUBLE(10,2)" json:"paid_price"` | PaidPrice float64 `xorm:"not null default 0.00 DOUBLE(10,2)" json:"paid_price"` | ||||
OrderType int `xorm:"not null default 0 TINYINT(1)" json:"order_type"` | OrderType int `xorm:"not null default 0 TINYINT(1)" json:"order_type"` | ||||
ShareUid int `xorm:"not null default 0 TINYINT(1)" json:"share_uid"` | |||||
PriceType int `xorm:"not null default 0 INT(1)" json:"price_type"` | PriceType int `xorm:"not null default 0 INT(1)" json:"price_type"` | ||||
SecondPriceType int `xorm:"not null default 0 INT(1)" json:"second_price_type"` | SecondPriceType int `xorm:"not null default 0 INT(1)" json:"second_price_type"` | ||||
FourPriceType int `xorm:"not null default 0 INT(1)" json:"four_price_type"` | FourPriceType int `xorm:"not null default 0 INT(1)" json:"four_price_type"` | ||||
@@ -175,6 +175,7 @@ type OrderInfo struct { | |||||
TikTokTeamCommission string | TikTokTeamCommission string | ||||
TikTokTeamRealCommission string | TikTokTeamRealCommission string | ||||
OptPvd string | OptPvd string | ||||
ShareUid string | |||||
} | } | ||||
type OrderFindRequest struct { | type OrderFindRequest struct { | ||||
@@ -912,7 +912,7 @@ func orderFourFreeCheck(eg *xorm.Engine, v *md.OrderInfo, oid int64, uid int, is | |||||
eg.Where("id=?", tmp.Id).Cols("is_buy").Update(&tmp) | eg.Where("id=?", tmp.Id).Cols("is_buy").Update(&tmp) | ||||
m.Sale++ | m.Sale++ | ||||
eg.Where("id=?", m.Id).Cols("sale").Update(m) | eg.Where("id=?", m.Id).Cols("sale").Update(m) | ||||
StationDeduct(utils.Int64ToStr(oid), v.PvdOid, dbName) | |||||
//StationDeduct(utils.Int64ToStr(oid), v.PvdOid, dbName) | |||||
} | } | ||||
return m | return m | ||||
} | } | ||||
@@ -484,6 +484,13 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI | |||||
if user != nil { | if user != nil { | ||||
user.OwnbuyReturnType = ownbuyReturnType //是否有自购奖励 | user.OwnbuyReturnType = ownbuyReturnType //是否有自购奖励 | ||||
uid = user.Uid | uid = user.Uid | ||||
if utils.StrToInt(v.ShareUid) > 0 { | |||||
uid = utils.StrToInt(v.ShareUid) | |||||
} | |||||
profile, _ := db.UserProfileFindByID(eg, uid) | |||||
if profile != nil && profile.ParentUid == utils.StrToInt(v.ShareUid) && utils.StrToInt(v.ShareUid) > 0 { | |||||
uid = user.Uid | |||||
} | |||||
isShare := 0 | isShare := 0 | ||||
if v.OrderType == md.OrderTypeShare || v.OrderType == md.OrderTypeWechatActShare { | if v.OrderType == md.OrderTypeShare || v.OrderType == md.OrderTypeWechatActShare { | ||||
isShare = 1 | isShare = 1 | ||||
@@ -774,6 +781,7 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI | |||||
ItemPrice: v.ItemPrice, | ItemPrice: v.ItemPrice, | ||||
PaidPrice: v.PaidPrice, | PaidPrice: v.PaidPrice, | ||||
OrderType: v.OrderType, | OrderType: v.OrderType, | ||||
ShareUid: utils.StrToInt(v.ShareUid), | |||||
PriceType: priceType, | PriceType: priceType, | ||||
SecondPriceType: secondPriceType, | SecondPriceType: secondPriceType, | ||||
FourPriceType: fourPriceType, | FourPriceType: fourPriceType, | ||||
@@ -843,6 +851,10 @@ func OrderSaveCreateUpdateZero(eg *xorm.Engine, pvd string, ordData *[]md.OrderI | |||||
// lvUser.AdditionalSubsidy = v.Commission | // lvUser.AdditionalSubsidy = v.Commission | ||||
//} | //} | ||||
OrderRelateInsert(eg, oid, newPvd, newOrd.CreateAt, lvUser, newOrd, dbName, false, mode, "1") | OrderRelateInsert(eg, oid, newPvd, newOrd.CreateAt, lvUser, newOrd, dbName, false, mode, "1") | ||||
if lvUser.Uid != user.Uid { | |||||
data := model.OrdListRelate{Oid: oid, Uid: user.Uid, Amount: 0, AdditionalSubsidy: "0", Pvd: pvd, CreateAt: newOrd.CreateAt, Level: 0, Mode: mode, ExtendType: 6} | |||||
eg.InsertOne(&data) | |||||
} | |||||
} else if returnMoneyOne != nil && returnMoneyType == "1" { | } else if returnMoneyOne != nil && returnMoneyType == "1" { | ||||
OrderReturnMoneyRelateInsert(eg, oid, newPvd, newOrd.CreateAt, returnMoneyOne, newOrd, dbName, false) | OrderReturnMoneyRelateInsert(eg, oid, newPvd, newOrd.CreateAt, returnMoneyOne, newOrd, dbName, false) | ||||
} | } | ||||
@@ -5,7 +5,7 @@ go 1.18 | |||||
require ( | require ( | ||||
code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git v1.1.2 | code.fnuoos.com/go_rely_warehouse/zyos_go_coupon.git v1.1.2 | ||||
code.fnuoos.com/go_rely_warehouse/zyos_go_day_luck_draw.git v1.2.1 | code.fnuoos.com/go_rely_warehouse/zyos_go_day_luck_draw.git v1.2.1 | ||||
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.0 | |||||
code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be | |||||
code.fnuoos.com/go_rely_warehouse/zyos_go_jg_push.git v1.0.5 | code.fnuoos.com/go_rely_warehouse/zyos_go_jg_push.git v1.0.5 | ||||
code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 | code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 | ||||
code.fnuoos.com/go_rely_warehouse/zyos_go_o2o_business.git v1.0.9 | code.fnuoos.com/go_rely_warehouse/zyos_go_o2o_business.git v1.0.9 | ||||
@@ -18,7 +18,7 @@ require ( | |||||
github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 | github.com/dchest/uniuri v0.0.0-20200228104902-7aecb25e1fe5 | ||||
github.com/dgrijalva/jwt-go v3.2.0+incompatible | github.com/dgrijalva/jwt-go v3.2.0+incompatible | ||||
github.com/forgoer/openssl v1.2.1 | github.com/forgoer/openssl v1.2.1 | ||||
github.com/gin-contrib/sessions v1.0.0 | |||||
github.com/gin-contrib/sessions v1.0.1 | |||||
github.com/gin-gonic/gin v1.9.1 | github.com/gin-gonic/gin v1.9.1 | ||||
github.com/go-playground/locales v0.14.1 | github.com/go-playground/locales v0.14.1 | ||||
github.com/go-playground/universal-translator v0.18.1 | github.com/go-playground/universal-translator v0.18.1 | ||||
@@ -108,5 +108,5 @@ require ( | |||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect | google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect | ||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||||
gopkg.in/yaml.v3 v3.0.1 // indirect | gopkg.in/yaml.v3 v3.0.1 // indirect | ||||
xorm.io/builder v0.3.11-0.20220531020008-1bd24a7dc978 // indirect | |||||
xorm.io/builder v0.3.13 // indirect | |||||
) | ) |