impl.DBService.Model(&models.WalletRecord{}).Select("sum(money)").Where("passport_id=? AND trans_type=? AND ymd=?",auth.ID,transIn,ymd).Scan(&totalMoney)
total["TodayIn"]=totalMoney
}
// 统计当日支出
ifin.IsTotalTodayOut{
impl.DBService.Model(&models.WalletRecord{}).Select("sum(money)").Where("passport_id=? AND trans_type=? AND ymd=?",auth.ID,transOut,ymd).Scan(&totalMoney)
total["TodayOut"]=totalMoney
}
// 统计本月收入
ifin.IsTotalMonthIn{
impl.DBService.Model(&models.WalletRecord{}).Select("sum(money)").Where("passport_id=? AND trans_type=? AND ym=?",auth.ID,transIn,ym).Scan(&totalMoney)
total["MonthIn"]=totalMoney
}
// 统计本月支出
ifin.IsTotalMonthOut{
impl.DBService.Model(&models.WalletRecord{}).Select("sum(money)").Where("passport_id=? AND trans_type=? AND ym=?",auth.ID,transOut,ym).Scan(&totalMoney)
total["MonthOut"]=totalMoney
}
// 统计全部收入
ifin.IsTotalAllIn{
impl.DBService.Model(&models.WalletRecord{}).Select("sum(money)").Where("passport_id=? AND trans_type=? ",auth.ID,transIn).Scan(&totalMoney)
total["AllIn"]=totalMoney
}
// 统计全部支出
ifin.IsTotalAllOut{
impl.DBService.Model(&models.WalletRecord{}).Select("sum(money)").Where("passport_id=? AND trans_type=? ",auth.ID,transOut).Scan(&totalMoney)