修复离线上报跨年生成错误的问题

This commit is contained in:
wlx 2014-01-07 12:33:15 +00:00
parent 124ad5263a
commit 4408b36c34
1 changed files with 7 additions and 1 deletions

View File

@ -1055,9 +1055,15 @@ class Admin_DownController extends Zend_Controller_Action
//设置当前活动sheet的名称 //设置当前活动sheet的名称
$objActSheet->setTitle('离线服务记录'); $objActSheet->setTitle('离线服务记录');
if (date('m')==1)
{
$ym=(date('Y')-1).'-12-1';
} else {
$ym=date('Y-').(date('m')-1).'-1';
}
$sql="select o.username,o.unit,o.phone,o.address,o.postcode,o.project,regexp_replace(o.datalist,'\(.+?MB\)','','g') as datalist,date(o.ts_approved) as date,o.email,o.project_id,o.project_type,o.project_title,sum(m.filesize) as filesize $sql="select o.username,o.unit,o.phone,o.address,o.postcode,o.project,regexp_replace(o.datalist,'\(.+?MB\)','','g') as datalist,date(o.ts_approved) as date,o.email,o.project_id,o.project_type,o.project_title,sum(m.filesize) as filesize
from offlineapp o left join dataorder d on o.id=d.offlineappid left join metadata m on d.uuid=m.uuid from offlineapp o left join dataorder d on o.id=d.offlineappid left join metadata m on d.uuid=m.uuid
where o.ts_approved>='".date('Y-').(date('m')-1)."-1' and o.ts_approved<'".date('Y-m')."-1' and o.pdflink is not null and o.ts_approved is not null and d.status=5 group by o.id order by o. ts_approved where o.ts_approved>='".$ym."' and o.ts_approved<'".date('Y-m')."-1' and o.pdflink is not null and o.ts_approved is not null and d.status=5 group by o.id order by o. ts_approved
"; ";
$re = $this->db->query($sql); $re = $this->db->query($sql);
$rows = $re->fetchAll(); $rows = $re->fetchAll();