@@ -57,7 +57,7 @@ func GetGuideOrderList(args map[string]string) []model.GuideOrder { | |||||
sort = args["sort"] | sort = args["sort"] | ||||
} | } | ||||
if args["is_to_settle"] == "1" { | if args["is_to_settle"] == "1" { | ||||
sess = sess.And("settle_time=?", 0) | |||||
sess = sess.And("platform_settle_time=?", 0) | |||||
} | } | ||||
if args["is_commission"] == "1" { | if args["is_commission"] == "1" { | ||||
sess = sess.And("real_commission>?", 0) | sess = sess.And("real_commission>?", 0) | ||||
@@ -23,20 +23,25 @@ func GuideOrderList(c *gin.Context, args map[string]string) ([]map[string]string | |||||
settleStatus = "已结算" | settleStatus = "已结算" | ||||
settleTime = time.Unix(int64(v.SettleTime), 0).Format("2006-01-02 15:04:05") | 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{ | 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) | data = append(data, tmp) | ||||
} | } | ||||
@@ -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") | settleTime = time.Unix(int64(v.SettleTime), 0).Format("2006-01-02 15:04:05") | ||||
} | } | ||||
var tmp = map[string]string{ | 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) | data = append(data, tmp) | ||||
} | } | ||||
@@ -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") | settleTime = time.Unix(int64(v.SettleTime), 0).Format("2006-01-02 15:04:05") | ||||
} | } | ||||
var tmp = map[string]string{ | 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"), | "create_time": v.CreateTime.Format("2006-01-02 15:04:05"), | ||||
"settle_time": settleTime, | "settle_time": settleTime, | ||||
"commission_bili": "-", | "commission_bili": "-", | ||||
@@ -11,7 +11,7 @@ import ( | |||||
func HwOrderSettle() { | func HwOrderSettle() { | ||||
day := time.Now().Day() | day := time.Now().Day() | ||||
if day < 15 { | |||||
if day < 20 { | |||||
return | return | ||||
} | } | ||||
month := utils.GetTimeRange("current_month") | month := utils.GetTimeRange("current_month") | ||||
@@ -11,7 +11,7 @@ import ( | |||||
func PlayletOrderSettle() { | func PlayletOrderSettle() { | ||||
day := time.Now().Day() | day := time.Now().Day() | ||||
if day < 5 { | |||||
if day < 20 { | |||||
return | return | ||||
} | } | ||||
month := utils.GetTimeRange("current_month") | month := utils.GetTimeRange("current_month") | ||||
@@ -132,12 +132,14 @@ func AddTikTokLocalLifeOrder(order md.TikTokLocalLifeOrderDetail) { | |||||
if order.CommissionInfo.AllSettleRemitFinish || order.Status != 2 { | if order.CommissionInfo.AllSettleRemitFinish || order.Status != 2 { | ||||
var amount int64 = 0 | var amount int64 = 0 | ||||
isEnd := 1 | isEnd := 1 | ||||
var endTime int64 = 0 | |||||
for _, v := range order.CommissionInfo.SettleInfoMap { | for _, v := range order.CommissionInfo.SettleInfoMap { | ||||
tmp, ok := v.(map[string]interface{}) | tmp, ok := v.(map[string]interface{}) | ||||
if ok == false || utils.AnyToInt64(tmp["status"]) < 3 { | if ok == false || utils.AnyToInt64(tmp["status"]) < 3 { | ||||
isEnd = 0 | isEnd = 0 | ||||
} | } | ||||
if ok && utils.AnyToInt64(tmp["status"]) == 3 { | if ok && utils.AnyToInt64(tmp["status"]) == 3 { | ||||
endTime = utils.AnyToInt64(tmp["settle_time"]) | |||||
amount += utils.AnyToInt64(tmp["settle_amount"]) | amount += utils.AnyToInt64(tmp["settle_amount"]) | ||||
} | } | ||||
} | } | ||||
@@ -149,7 +151,10 @@ func AddTikTokLocalLifeOrder(order md.TikTokLocalLifeOrderDetail) { | |||||
if order.Status == 5 { | if order.Status == 5 { | ||||
ord.Status = "部分结算" | 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) | ord.RealCommission = utils.Float64ToStr(float64(amount) / 100) | ||||
} | } | ||||
} | } | ||||
@@ -160,6 +165,9 @@ func AddTikTokLocalLifeOrder(order md.TikTokLocalLifeOrderDetail) { | |||||
fmt.Println(err) | fmt.Println(err) | ||||
} else { | } else { | ||||
ord.SettleTime = one.SettleTime | ord.SettleTime = one.SettleTime | ||||
if one.PlatformSettleTime > 0 { | |||||
ord.PlatformSettleTime = one.PlatformSettleTime | |||||
} | |||||
db.ZhimengDb.Where("id=?", one.Id).AllCols().Update(ord) | db.ZhimengDb.Where("id=?", one.Id).AllCols().Update(ord) | ||||
} | } | ||||
return | return | ||||
@@ -11,7 +11,7 @@ import ( | |||||
func TikTokLocalLifeOrderSettle() { | func TikTokLocalLifeOrderSettle() { | ||||
day := time.Now().Day() | day := time.Now().Day() | ||||
if day < 15 { | |||||
if day < 20 { | |||||
return | return | ||||
} | } | ||||
month := utils.GetTimeRange("current_month") | month := utils.GetTimeRange("current_month") | ||||