From 95503ee52966e7d1e2f8f15cda6cac618e1bcf20 Mon Sep 17 00:00:00 2001 From: jiangyong27 Date: Tue, 1 Apr 2025 21:32:18 +0800 Subject: [PATCH] addata --- common/dao/external_unify_ad_data.go | 1 - common/model/external_unify.go | 3 --- service/salary_calculator/salary_calculator_1000.go | 8 ++++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/common/dao/external_unify_ad_data.go b/common/dao/external_unify_ad_data.go index 13b54b3..a6a4b12 100644 --- a/common/dao/external_unify_ad_data.go +++ b/common/dao/external_unify_ad_data.go @@ -21,7 +21,6 @@ func (d *UnifyAdData) QueryOwnerData(owner, startDay, endDay string) ([]*model.E var o []*model.ExternalUnifyAdData - tx = tx.Where("data_type = ?", "account_report") tx = tx.Where("owner = ?", owner) if startDay != "" { tx = tx.Where("day >= ?", startDay) diff --git a/common/model/external_unify.go b/common/model/external_unify.go index f2ee88b..0b29151 100644 --- a/common/model/external_unify.go +++ b/common/model/external_unify.go @@ -9,9 +9,6 @@ type ExternalUnifyAdData struct { AccountId string `json:"accountId"` Owner string `json:"owner"` Balance int64 `json:"balance"` - DataType string `json:"dataType"` - DataName string `json:"dataName"` - DataId string `json:"dataId"` Cost int64 `json:"cost"` PayAmount int64 `json:"payAmount"` Impression int64 `json:"impression"` diff --git a/service/salary_calculator/salary_calculator_1000.go b/service/salary_calculator/salary_calculator_1000.go index 290a725..aa61958 100644 --- a/service/salary_calculator/salary_calculator_1000.go +++ b/service/salary_calculator/salary_calculator_1000.go @@ -32,8 +32,8 @@ func (s *SalaryCalculator1000) Calculate(salary *model.StaffSalary) map[string]i data := make(map[string]interface{}) data["adProfit"] = s.getAdOwnerProfit(salary) - data["app10024Profit"] = s.getAppProfit(10024, salary.Month) - data["app10024Profit2"] = s.getAppProfit(10024, monthTime.AddDate(0, -1, 0).Format("200601")) + data["app10024Profit"] = s.getKctAppProfit(salary.Month) + data["app10024Profit2"] = s.getKctAppProfit(monthTime.AddDate(0, -1, 0).Format("200601")) return data } @@ -55,7 +55,7 @@ func (s *SalaryCalculator1000) getAdOwnerProfit(salary *model.StaffSalary) float return totalProfit } -func (s *SalaryCalculator1000) getAppProfit(appid int64, month string) float64 { +func (s *SalaryCalculator1000) getKctAppProfit(month string) float64 { monthTime, _ := time.ParseInLocation("200601", month, time.Local) @@ -69,7 +69,7 @@ func (s *SalaryCalculator1000) getAppProfit(appid int64, month string) float64 { } for _, data := range datas { - sumProfitAmount += data.PayAmount - data.RefundAmount - data.Cost + sumProfitAmount += data.PayAmount - data.RefundAmount - data.AdCost } return float64(sumProfitAmount) / 100 }