From 2fc9e90cc6cb30d10f3f09b14728992b9f5f60b4 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 13 Nov 2024 18:14:26 +0800 Subject: [PATCH] 1 --- app/hdl/hdl_store_index.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/hdl/hdl_store_index.go b/app/hdl/hdl_store_index.go index 801f6db..8df3a95 100644 --- a/app/hdl/hdl_store_index.go +++ b/app/hdl/hdl_store_index.go @@ -60,10 +60,14 @@ func StoreIndexTotal(c *gin.Context) { tmp := []map[string]string{ {"name": "营业总额", "value": svc.GetCommissionPrec(c, amount, "2", "1")}, } - if store.StoreType == 0 { - tmp = append(tmp, map[string]string{"name": "佣金收益", "value": svc.GetCommissionPrec(c, commission, "2", "1")}) - } - if store.StoreType > 0 { + if store != nil { + if store.StoreType == 0 { + tmp = append(tmp, map[string]string{"name": "佣金收益", "value": svc.GetCommissionPrec(c, commission, "2", "1")}) + } + if store.StoreType > 0 { + tmp = append(tmp, map[string]string{"name": "订单收益", "value": svc.GetCommissionPrec(c, money, "2", "1")}) + } + } else { tmp = append(tmp, map[string]string{"name": "订单收益", "value": svc.GetCommissionPrec(c, money, "2", "1")}) } tmp = append(tmp, map[string]string{"name": "已付款订单量", "value": utils.IntToStr(utils.StrToInt(successCount))})