修改了后台操作中相关申请表字段的读取

This commit is contained in:
Li Jianxuan 2013-09-06 08:15:16 +00:00
parent e93fe95ed6
commit b2b627c8db
3 changed files with 12 additions and 17 deletions

View File

@ -200,9 +200,9 @@ class Admin_DownController extends Zend_Controller_Action
$mail->setFrom($this->view->config->service->email,'西部数据中心服务组');
$mail->send();
$sql="SELECT applicationform FROM dataorder WHERE offlineappid=$start";
$sql="select applicationform as pdflink from offlineapp where id=?";
$row=$this->db->fetchRow($sql,array($start));
$filecontent=file_get_contents($this->view->config->offline->savepath."/".$row['applicationform']);
$filecontent=file_get_contents($this->view->config->offline->savepath."/".$row['pdflink']);
//对每条数据的管理员用户发送相应的邮件通知,同一用户的邮件需要合并
//需要取出对应数据的标题、uuid以及对应的作者的email一条数据可能有多个作者一次申请可能有多条数据对应同一个作者

View File

@ -40,7 +40,7 @@ class Dataorder
$wheresql = "";
}
$sql = "select distinct(o.*),d.id as orderid,d.status as datastatus,d.applicationform from ".$this->tbl_Offlineapp." o
$sql = "select distinct(o.*),d.id as orderid,d.status as datastatus from ".$this->tbl_Offlineapp." o
left join ".$this->tbl_Dataorder." d on o.id = d.offlineappid
$wheresql
order by o.ts_created desc";

View File

@ -69,7 +69,7 @@ class Offlineapp
//获取一个申请的详细信息
public function getOneAppInfo($id)
{
$sql = "SELECT off.*,o.status,o.applicationform FROM offlineapp off
$sql = "SELECT off.*,o.status FROM offlineapp off
LEFT JOIN dataorder o ON off.id=o.offlineappid
WHERE off.id = $id
";
@ -80,23 +80,18 @@ class Offlineapp
//重置申请表
public function resetAppForm($id)
{
$sql = "SELECT * FROM dataorder WHERE offlineappid=$id";
$sql = "SELECT * FROM offlineapp WHERE id=$id";
$rs = $this->db->query($sql);
$rows = $rs->fetchAll();
$row = $rs->fetch();
$ids = array();
foreach($rows as $v)
if(file_exists($row['applicationform']))
{
$ids[] = $v['id'];
@unlink($row['applicationform']);
}
if(file_exists($rows[0]['applicationform']))
{
@unlink($rows[0]['applicationform']);
}
if($this->db->exec("UPDATE dataorder SET applicationform=NULL WHERE offlineappid=$id")>0)
if($this->db->exec("UPDATE offlineapp SET applicationform=NULL WHERE id=$id")>0)
{
@$this->events()->trigger('offlineapp.AppFormReseted', $this, compact('id'));
return true;
@ -138,7 +133,7 @@ class Offlineapp
public function fetchNoPdf()
{
$opt = $this->offLineAppMakeQuery(array(
'where' => ' o.offlineappid != -1 AND o.status=4 AND (o.applicationform IS NULL OR o.applicationform=\'\') '
'where' => ' o.offlineappid != -1 AND o.status=4 AND (off.applicationform IS NULL OR off.applicationform=\'\') '
));
$dbh = new dbh();
//echo $dbh->select($opt,true);exit();
@ -148,7 +143,7 @@ class Offlineapp
public function fetchNotApprove()
{
$opt = $this->offLineAppMakeQuery(array(
'where' => ' o.offlineappid != -1 AND o.status=4 AND (o.applicationform IS NOT NULL || o.applicationform!=\'\') '
'where' => ' o.offlineappid != -1 AND o.status=4 AND (off.applicationform IS NOT NULL || off.applicationform!=\'\') '
));
$dbh = new dbh();
return $dbh->select($opt);