This commit is contained in:
苏尹岚
2021-01-04 15:50:34 +08:00
parent ccdc532142
commit 78bb668fad

View File

@@ -242,7 +242,7 @@ func getFromSql(orderType, status int, alies string, userID string, pop int, cit
func GetPayStatistics(db *DaoDB, userID string, pop int, cityCodes []int, mobile string, fromTime, toTime time.Time, orderTypes []int) (getPayStatisticsResult *GetPayStatisticsResult, err error) { func GetPayStatistics(db *DaoDB, userID string, pop int, cityCodes []int, mobile string, fromTime, toTime time.Time, orderTypes []int) (getPayStatisticsResult *GetPayStatisticsResult, err error) {
sqlParams := []interface{}{} sqlParams := []interface{}{}
sql := `SELECT t1.total_pay, t2.total_pay submit_cash, t3.total_pay cashed, t4.account_balance, t4.account_balance + t2.total_pay can_cash, t3.total_pay / 10 cash_income sql := `SELECT t1.total_pay, t2.total_pay submit_cash, t3.total_pay cashed, t4.account_balance, t4.account_balance + t2.total_pay can_cash
FROM ` FROM `
rSQL1, rSQLParams1 := getFromSql(model.OrderTypePay, model.OrderStatusFinished, "t1", userID, pop, cityCodes, mobile, fromTime, toTime, orderTypes) rSQL1, rSQLParams1 := getFromSql(model.OrderTypePay, model.OrderStatusFinished, "t1", userID, pop, cityCodes, mobile, fromTime, toTime, orderTypes)
sql += rSQL1 + "," sql += rSQL1 + ","
@@ -333,6 +333,7 @@ func GetPayStatistics(db *DaoDB, userID string, pop int, cityCodes []int, mobile
} }
err = GetRow(db, &getPayStatisticsResult1, sql2, sqlParams2) err = GetRow(db, &getPayStatisticsResult1, sql2, sqlParams2)
getPayStatisticsResult.MemberIncome = getPayStatisticsResult1.MemberIncome getPayStatisticsResult.MemberIncome = getPayStatisticsResult1.MemberIncome
getPayStatisticsResult.CashIncome = getPayStatisticsResult.Cashed / 10
getPayStatisticsResult.TotalIncome = getPayStatisticsResult.MemberIncome + getPayStatisticsResult.CashIncome getPayStatisticsResult.TotalIncome = getPayStatisticsResult.MemberIncome + getPayStatisticsResult.CashIncome
return getPayStatisticsResult, err return getPayStatisticsResult, err
} }