diff --git a/app/db/db_guide_order.go b/app/db/db_guide_order.go index 896ac28..9625a2a 100644 --- a/app/db/db_guide_order.go +++ b/app/db/db_guide_order.go @@ -57,7 +57,7 @@ func GetGuideOrderList(args map[string]string) []model.GuideOrder { sort = args["sort"] } if args["is_to_settle"] == "1" { - sess = sess.And("settle_time=?", 0) + sess = sess.And("platform_settle_time=?", 0) } if args["is_commission"] == "1" { sess = sess.And("real_commission>?", 0) diff --git a/app/svc/platform/svc_guide_order_list.go b/app/svc/platform/svc_guide_order_list.go index 5cb41ca..f3b3251 100644 --- a/app/svc/platform/svc_guide_order_list.go +++ b/app/svc/platform/svc_guide_order_list.go @@ -23,20 +23,25 @@ func GuideOrderList(c *gin.Context, args map[string]string) ([]map[string]string settleStatus = "已结算" settleTime = time.Unix(int64(v.SettleTime), 0).Format("2006-01-02 15:04:05") } + platformSettleTime := "-" + if v.SettleTime > 0 { + platformSettleTime = time.Unix(int64(v.PlatformSettleTime), 0).Format("2006-01-02 15:04:05") + } var tmp = map[string]string{ - "oid": v.PvdOid, - "uid": utils.IntToStr(v.StationUid), - "title": v.Title, - "platform_fee": "0", - "commission_bili": "", - "source": platformMap[v.Pvd], - "amount": v.Payment, - "commission": v.Commission, - "real_commission": v.RealCommission, - "status": v.Status, - "settle_status": settleStatus, - "create_time": time.Unix(int64(v.CreateTime), 0).Format("2006-01-02 15:04:05"), - "settle_time": settleTime, + "oid": v.PvdOid, + "uid": utils.IntToStr(v.StationUid), + "title": v.Title, + "platform_fee": "0", + "commission_bili": "", + "source": platformMap[v.Pvd], + "amount": v.Payment, + "commission": v.Commission, + "platform_settle_time": platformSettleTime, + "real_commission": v.RealCommission, + "status": v.Status, + "settle_status": settleStatus, + "create_time": time.Unix(int64(v.CreateTime), 0).Format("2006-01-02 15:04:05"), + "settle_time": settleTime, } data = append(data, tmp) } diff --git a/app/svc/platform/svc_hw_order_list.go b/app/svc/platform/svc_hw_order_list.go index 1205868..9fe0eba 100644 --- a/app/svc/platform/svc_hw_order_list.go +++ b/app/svc/platform/svc_hw_order_list.go @@ -25,19 +25,20 @@ func HwOrderList(c *gin.Context, args map[string]string) ([]map[string]string, i settleTime = time.Unix(int64(v.SettleTime), 0).Format("2006-01-02 15:04:05") } var tmp = map[string]string{ - "oid": v.Oid, - "uid": v.Zuid, - "title": v.Info, - "platform_fee": "0", - "commission_bili": "", - "source": platformMap[v.Type], - "amount": utils.Float64ToStr(v.Payment), - "commission": utils.Float64ToStr(v.Commission), - "real_commission": utils.Float64ToStr(v.Commission), - "status": v.Status, - "settle_status": settleStatus, - "create_time": time.Unix(int64(v.CreateTime), 0).Format("2006-01-02 15:04:05"), - "settle_time": settleTime, + "oid": v.Oid, + "uid": v.Zuid, + "title": v.Info, + "platform_fee": "0", + "commission_bili": "", + "source": platformMap[v.Type], + "amount": utils.Float64ToStr(v.Payment), + "commission": utils.Float64ToStr(v.Commission), + "real_commission": utils.Float64ToStr(v.Commission), + "platform_settle_time": "-", + "status": v.Status, + "settle_status": settleStatus, + "create_time": time.Unix(int64(v.CreateTime), 0).Format("2006-01-02 15:04:05"), + "settle_time": settleTime, } data = append(data, tmp) } diff --git a/app/svc/platform/svc_order_list.go b/app/svc/platform/svc_order_list.go index 0f50cd1..f5e2063 100644 --- a/app/svc/platform/svc_order_list.go +++ b/app/svc/platform/svc_order_list.go @@ -27,17 +27,19 @@ func OrderList(c *gin.Context, args map[string]string) ([]map[string]string, int settleTime = time.Unix(int64(v.SettleTime), 0).Format("2006-01-02 15:04:05") } var tmp = map[string]string{ - "oid": v.Oid, - "mid": v.Uid, - "custom_oid": v.CustomOid, - "title": v.Title, - "source": source, - "amount": v.Amount, - "platform_fee": v.PlatformFee, - "commission": v.Commission, - "real_commission": v.Commission, - "status": v.Status, - "settle_status": settleStatus, + "oid": v.Oid, + "mid": v.Uid, + "custom_oid": v.CustomOid, + "title": v.Title, + "source": source, + "amount": v.Amount, + "platform_fee": v.PlatformFee, + "commission": v.Commission, + "real_commission": v.Commission, + "status": v.Status, + "settle_status": settleStatus, + "platform_settle_time": "-", + "create_time": v.CreateTime.Format("2006-01-02 15:04:05"), "settle_time": settleTime, "commission_bili": "-", diff --git a/app/task/svc/svc_hw_order_settle.go b/app/task/svc/svc_hw_order_settle.go index 43f3154..c9f1b5d 100644 --- a/app/task/svc/svc_hw_order_settle.go +++ b/app/task/svc/svc_hw_order_settle.go @@ -11,7 +11,7 @@ import ( func HwOrderSettle() { day := time.Now().Day() - if day < 15 { + if day < 20 { return } month := utils.GetTimeRange("current_month") diff --git a/app/task/svc/svc_playlet_order_settle.go b/app/task/svc/svc_playlet_order_settle.go index e523186..ea07a9c 100644 --- a/app/task/svc/svc_playlet_order_settle.go +++ b/app/task/svc/svc_playlet_order_settle.go @@ -11,7 +11,7 @@ import ( func PlayletOrderSettle() { day := time.Now().Day() - if day < 5 { + if day < 20 { return } month := utils.GetTimeRange("current_month") diff --git a/app/task/svc/svc_tik_tok_local_life_order.go b/app/task/svc/svc_tik_tok_local_life_order.go index c2fcd05..99d4697 100644 --- a/app/task/svc/svc_tik_tok_local_life_order.go +++ b/app/task/svc/svc_tik_tok_local_life_order.go @@ -132,12 +132,14 @@ func AddTikTokLocalLifeOrder(order md.TikTokLocalLifeOrderDetail) { if order.CommissionInfo.AllSettleRemitFinish || order.Status != 2 { var amount int64 = 0 isEnd := 1 + var endTime int64 = 0 for _, v := range order.CommissionInfo.SettleInfoMap { tmp, ok := v.(map[string]interface{}) if ok == false || utils.AnyToInt64(tmp["status"]) < 3 { isEnd = 0 } if ok && utils.AnyToInt64(tmp["status"]) == 3 { + endTime = utils.AnyToInt64(tmp["settle_time"]) amount += utils.AnyToInt64(tmp["settle_amount"]) } } @@ -149,7 +151,10 @@ func AddTikTokLocalLifeOrder(order md.TikTokLocalLifeOrderDetail) { if order.Status == 5 { ord.Status = "部分结算" } - ord.PlatformSettleTime = order.UpdateTime + ord.PlatformSettleTime = int(endTime) + if ord.PlatformSettleTime == 0 { + ord.PlatformSettleTime = ord.UpdateTime + } ord.RealCommission = utils.Float64ToStr(float64(amount) / 100) } } @@ -160,6 +165,9 @@ func AddTikTokLocalLifeOrder(order md.TikTokLocalLifeOrderDetail) { fmt.Println(err) } else { ord.SettleTime = one.SettleTime + if one.PlatformSettleTime > 0 { + ord.PlatformSettleTime = one.PlatformSettleTime + } db.ZhimengDb.Where("id=?", one.Id).AllCols().Update(ord) } return diff --git a/app/task/svc/svc_tik_tok_local_life_order_settle.go b/app/task/svc/svc_tik_tok_local_life_order_settle.go index 990cfac..acdc186 100644 --- a/app/task/svc/svc_tik_tok_local_life_order_settle.go +++ b/app/task/svc/svc_tik_tok_local_life_order_settle.go @@ -11,7 +11,7 @@ import ( func TikTokLocalLifeOrderSettle() { day := time.Now().Day() - if day < 15 { + if day < 20 { return } month := utils.GetTimeRange("current_month")