Browse Source

更新

master
huangjiajun 1 year ago
parent
commit
234f831856
2 changed files with 7 additions and 5 deletions
  1. +1
    -0
      app/db/model/playlet_sale_order.go
  2. +6
    -5
      app/task/svc/svc_tik_tok_task_money.go

+ 1
- 0
app/db/model/playlet_sale_order.go View File

@@ -28,5 +28,6 @@ type PlayletSaleOrder struct {
CustomOid string `json:"custom_oid" xorm:"VARCHAR(255)"`
ExtendUid string `json:"extend_uid" xorm:"VARCHAR(255)"`
Fee string `json:"fee" xorm:"default 0.00 DECIMAL(20,2)"`
TikFee string `json:"tik_fee" xorm:"default 0.00 DECIMAL(20,2)"`
PlatformFee string `json:"platform_fee" xorm:"default 0.00 DECIMAL(20,2)"`
}

+ 6
- 5
app/task/svc/svc_tik_tok_task_money.go View File

@@ -43,11 +43,11 @@ func TikTokTaskMoney(types string) {
var order = make([]md.TikTokTaskOrder, 0)
json.Unmarshal([]byte(orderStr), &order)
for _, v := range order {
discount := v.BillingGMV1D - v.BillingRefundGMV1D
discount := float64(v.BillingGMV1D)/100 - float64(v.BillingRefundGMV1D)/100
if discount < 0 {
discount = 0
}
commission := discount - v.TalentProfit1D - discount*15
commission := discount - float64(v.TalentProfit1D)/100 - discount*15/100
fee := discount - commission
oid := "douyin" + zhios_third_party_utils.Int64ToStr(v.VideoId) + date
oid = strings.ReplaceAll(oid, "_", "")
@@ -65,8 +65,8 @@ func TikTokTaskMoney(types string) {
SubUid: utils.StrToInt(split[1]),
Data: utils.SerializeStr(v),
Oid: oid,
Amount: utils.Float64ToStr(float64(discount) / 100),
Commission: utils.Float64ToStr(float64(commission) / 100),
Amount: utils.Float64ToStr(discount),
Commission: utils.Float64ToStr(commission),
CreateTime: utils.TimeParseStd(date + " 00:00:00"),
UpdateTime: time.Now(),
Title: v.VideoTitle,
@@ -75,7 +75,8 @@ func TikTokTaskMoney(types string) {
GoodsType: "playlet",
OrdType: "video",
ExtendUid: v.DouyinID + "_" + v.AgentID,
PlatformFee: utils.Float64ToStr(float64(fee) / 100),
PlatformFee: utils.Float64ToStr(fee),
TikFee: utils.Float64ToStr(float64(v.TalentProfit1D) / 100),
}
playletSaleOrderDb := db.PlayletSaleOrderDb{}
playletSaleOrderDb.Set()


Loading…
Cancel
Save