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))})