diff --git a/app/db/model/playlet_sale_order.go b/app/db/model/playlet_sale_order.go index 8a950dc..0f69855 100644 --- a/app/db/model/playlet_sale_order.go +++ b/app/db/model/playlet_sale_order.go @@ -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)"` } diff --git a/app/task/svc/svc_tik_tok_task_money.go b/app/task/svc/svc_tik_tok_task_money.go index b9b695c..1302826 100644 --- a/app/task/svc/svc_tik_tok_task_money.go +++ b/app/task/svc/svc_tik_tok_task_money.go @@ -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()