currentYearCount,err=engine.Table(charge.TableName()).Where("cid = ? and allocateyear >= ?",cid,year).Sum(charge,"allocateexpense")
iferr!=nil{
returnresult,err
varcountfloat64
ifselectType=="arrearage"{
count,err=engine.Table(charge.TableName()).Where("cid = ? and allocateyear < ? and createtime >= ? and createtime <= ?",cid,year,start,end).Sum(charge,"allocateexpense")
}elseifselectType=="current"{
count,err=engine.Table(charge.TableName()).Where("cid = ? and allocateyear >= ? and createtime >= ? and createtime <= ?",cid,year,start,end).Sum(charge,"allocateexpense")
}else{
count,err=engine.Table(charge.TableName()).Where("cid = ? and createtime >= ? and createtime <= ?",cid,start,end).Sum(charge,"allocateexpense")
}
currentYearStatistic:=&response.StatisticData{
Type:"current",
Count:currentYearCount,
}
// 获取陈欠物业费
varoldCountfloat64
oldCount,err=engine.Table(charge.TableName()).Where("cid = ? and allocateyear < ?",cid,year).Sum(charge,"allocateexpense")