@@ -0,0 +1,33 @@ | |||||
package zhimeng_platform | |||||
import ( | |||||
"github.com/gin-gonic/gin" | |||||
) | |||||
func NewOrderList(c *gin.Context) { | |||||
pvd := c.Params.ByName("pvd") | |||||
switch pvd { | |||||
case "playlet": | |||||
OrderList(c) | |||||
break | |||||
case "hw": | |||||
HwOrderList(c) | |||||
break | |||||
case "guide": | |||||
GuideOrderList(c) | |||||
} | |||||
} | |||||
func NewOrderOutput(c *gin.Context) { | |||||
pvd := c.Params.ByName("pvd") | |||||
switch pvd { | |||||
case "playlet": | |||||
OrderOutput(c) | |||||
break | |||||
case "hw": | |||||
HwOrderOutput(c) | |||||
break | |||||
case "guide": | |||||
GuideOrderOutput(c) | |||||
} | |||||
} |
@@ -13,31 +13,16 @@ func OrderList(c *gin.Context) { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS, err) | e.OutErr(c, e.ERR_INVALID_ARGS, err) | ||||
return | return | ||||
} | } | ||||
platformMaps := []string{ | |||||
"starbucks", "movie", "mcdonald", "nayuki", "luckin", "pizza", "pagoda", "burger_king", "heytea", "to_kfc", "wallace", "flowerCake", "delivery", "tourism", | |||||
} | |||||
platformMap := map[string]string{ | |||||
"starbucks": "星巴克", "movie": "电影", "mcdonald": "麦当劳", "nayuki": "奈雪", "luckin": "瑞幸咖啡", "pizza": "必胜客", | |||||
"pagoda": "百果园", "burger_king": "汉堡王", "heytea": "喜茶", "to_kfc": "肯德基", "wallace": "华莱士", "flowerCake": "鲜花", "delivery": "比价寄", "tourism": "出游", | |||||
} | |||||
var data = make([]map[string]string, 0) | var data = make([]map[string]string, 0) | ||||
var total int64 | var total int64 | ||||
if utils.InArr(args["source"], platformMaps) { | |||||
data, total = platform.HwOrderList(c, args) | |||||
} else { | |||||
data, total = platform.OrderList(c, args) | |||||
} | |||||
data, total = platform.OrderList(c, args) | |||||
sourceList := []map[string]string{ | sourceList := []map[string]string{ | ||||
{"name": "短剧", "value": "video"}, | {"name": "短剧", "value": "video"}, | ||||
{"name": "广告", "value": "adv"}, | {"name": "广告", "value": "adv"}, | ||||
} | } | ||||
for k, v := range platformMap { | |||||
tmp := map[string]string{ | |||||
"name": v, "value": k, | |||||
} | |||||
sourceList = append(sourceList, tmp) | |||||
} | |||||
videoList := []map[string]string{ | videoList := []map[string]string{ | ||||
{"name": "抖音", "value": "douyin"}, | {"name": "抖音", "value": "douyin"}, | ||||
{"name": "快手", "value": "kuaishou"}, | {"name": "快手", "value": "kuaishou"}, | ||||
@@ -69,17 +54,10 @@ func OrderOutput(c *gin.Context) { | |||||
e.OutErr(c, e.ERR_INVALID_ARGS, err) | e.OutErr(c, e.ERR_INVALID_ARGS, err) | ||||
return | return | ||||
} | } | ||||
platformMap := []string{ | |||||
"starbucks", "movie", "mcdonald", "nayuki", "luckin", "pizza", "pagoda", "burger_king", "heytea", "to_kfc", "wallace", "flowerCake", "delivery", "tourism", | |||||
} | |||||
var data map[string]string | var data map[string]string | ||||
var name string | var name string | ||||
if utils.InArr(args["source"], platformMap) { | |||||
name, data = platform.HwOrderOutput(c, args) | |||||
} else { | |||||
name, data = platform.OrderOutput(c, args) | |||||
} | |||||
name, data = platform.OrderOutput(c, args) | |||||
file := utils.Output(c, name, data) | file := utils.Output(c, name, data) | ||||
filename := name + ".xlsx" | filename := name + ".xlsx" | ||||
r := map[string]string{ | r := map[string]string{ | ||||
@@ -74,10 +74,12 @@ func routeZhimeng(r *gin.RouterGroup) { | |||||
{ | { | ||||
r.POST("/order_list", platformHdl.OrderList) | r.POST("/order_list", platformHdl.OrderList) | ||||
r.POST("/order_output", platformHdl.OrderOutput) | r.POST("/order_output", platformHdl.OrderOutput) | ||||
r.POST("/hw_order_list", platformHdl.HwOrderList) | |||||
r.POST("/hw_order_output", platformHdl.HwOrderOutput) | |||||
r.POST("/guide_order_list", platformHdl.GuideOrderList) | |||||
r.POST("/guide_order_output", platformHdl.GuideOrderOutput) | |||||
r.POST("/:pvd/order_list", platformHdl.NewOrderList) | |||||
r.POST("/:pvd/order_output", platformHdl.NewOrderOutput) | |||||
//r.POST("/hw_order_list", platformHdl.HwOrderList) | |||||
//r.POST("/hw_order_output", platformHdl.HwOrderOutput) | |||||
//r.POST("/guide_order_list", platformHdl.GuideOrderList) | |||||
//r.POST("/guide_order_output", platformHdl.GuideOrderOutput) | |||||
r.POST("/withdrawal_income", platformHdl.WithdrawalIncome) | r.POST("/withdrawal_income", platformHdl.WithdrawalIncome) | ||||
r.POST("/withdrawal_bind_alipay", platformHdl.WithdrawalBindAlipay) | r.POST("/withdrawal_bind_alipay", platformHdl.WithdrawalBindAlipay) | ||||
@@ -33,6 +33,7 @@ func HwOrderList(c *gin.Context, args map[string]string) ([]map[string]string, i | |||||
"source": platformMap[v.Type], | "source": platformMap[v.Type], | ||||
"amount": utils.Float64ToStr(v.Payment), | "amount": utils.Float64ToStr(v.Payment), | ||||
"commission": utils.Float64ToStr(v.Commission), | "commission": utils.Float64ToStr(v.Commission), | ||||
"real_commission": utils.Float64ToStr(v.Commission), | |||||
"status": v.Status, | "status": v.Status, | ||||
"settle_status": settleStatus, | "settle_status": settleStatus, | ||||
"create_time": time.Unix(int64(v.CreateTime), 0).Format("2006-01-02 15:04:05"), | "create_time": time.Unix(int64(v.CreateTime), 0).Format("2006-01-02 15:04:05"), | ||||
@@ -35,6 +35,7 @@ func OrderList(c *gin.Context, args map[string]string) ([]map[string]string, int | |||||
"amount": v.Amount, | "amount": v.Amount, | ||||
"platform_fee": v.PlatformFee, | "platform_fee": v.PlatformFee, | ||||
"commission": v.Commission, | "commission": v.Commission, | ||||
"real_commission": v.Commission, | |||||
"status": v.Status, | "status": v.Status, | ||||
"settle_status": settleStatus, | "settle_status": settleStatus, | ||||
"create_time": v.CreateTime.Format("2006-01-02 15:04:05"), | "create_time": v.CreateTime.Format("2006-01-02 15:04:05"), | ||||