From 543651b58971afeac17dfbb5529d77447d190df8 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 19 Oct 2023 14:57:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zhimeng_platform/hdl_new_order_list.go | 33 +++++++++++++++++++ app/hdl/zhimeng_platform/hdl_order_list.go | 32 +++--------------- app/router/router.go | 10 +++--- app/svc/platform/svc_hw_order_list.go | 1 + app/svc/platform/svc_order_list.go | 1 + 5 files changed, 46 insertions(+), 31 deletions(-) create mode 100644 app/hdl/zhimeng_platform/hdl_new_order_list.go diff --git a/app/hdl/zhimeng_platform/hdl_new_order_list.go b/app/hdl/zhimeng_platform/hdl_new_order_list.go new file mode 100644 index 0000000..94c6d6c --- /dev/null +++ b/app/hdl/zhimeng_platform/hdl_new_order_list.go @@ -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) + } +} diff --git a/app/hdl/zhimeng_platform/hdl_order_list.go b/app/hdl/zhimeng_platform/hdl_order_list.go index 9843a01..ba7fa37 100644 --- a/app/hdl/zhimeng_platform/hdl_order_list.go +++ b/app/hdl/zhimeng_platform/hdl_order_list.go @@ -13,31 +13,16 @@ func OrderList(c *gin.Context) { e.OutErr(c, e.ERR_INVALID_ARGS, err) 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 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{ {"name": "短剧", "value": "video"}, {"name": "广告", "value": "adv"}, } - for k, v := range platformMap { - tmp := map[string]string{ - "name": v, "value": k, - } - sourceList = append(sourceList, tmp) - } videoList := []map[string]string{ {"name": "抖音", "value": "douyin"}, {"name": "快手", "value": "kuaishou"}, @@ -69,17 +54,10 @@ func OrderOutput(c *gin.Context) { e.OutErr(c, e.ERR_INVALID_ARGS, err) 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 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) filename := name + ".xlsx" r := map[string]string{ diff --git a/app/router/router.go b/app/router/router.go index 716497d..aa0533b 100644 --- a/app/router/router.go +++ b/app/router/router.go @@ -74,10 +74,12 @@ func routeZhimeng(r *gin.RouterGroup) { { r.POST("/order_list", platformHdl.OrderList) 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_bind_alipay", platformHdl.WithdrawalBindAlipay) diff --git a/app/svc/platform/svc_hw_order_list.go b/app/svc/platform/svc_hw_order_list.go index 34daeda..1205868 100644 --- a/app/svc/platform/svc_hw_order_list.go +++ b/app/svc/platform/svc_hw_order_list.go @@ -33,6 +33,7 @@ func HwOrderList(c *gin.Context, args map[string]string) ([]map[string]string, i "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"), diff --git a/app/svc/platform/svc_order_list.go b/app/svc/platform/svc_order_list.go index b306d31..0f50cd1 100644 --- a/app/svc/platform/svc_order_list.go +++ b/app/svc/platform/svc_order_list.go @@ -35,6 +35,7 @@ func OrderList(c *gin.Context, args map[string]string) ([]map[string]string, int "amount": v.Amount, "platform_fee": v.PlatformFee, "commission": v.Commission, + "real_commission": v.Commission, "status": v.Status, "settle_status": settleStatus, "create_time": v.CreateTime.Format("2006-01-02 15:04:05"),