修改了project_leader在pdf中读取的bug,添加了提交离线申请后更新信息到用户表的功能

This commit is contained in:
Li Jianxuan 2013-09-06 07:05:33 +00:00
parent e73480fb38
commit b0cb441d47
3 changed files with 28 additions and 6 deletions

View File

@ -1202,6 +1202,7 @@ class DataController extends Zend_Controller_Action
$datas['project_id'] = $this->_request->getParam('project_id'); $datas['project_id'] = $this->_request->getParam('project_id');
$datas['project_type'] = $this->_request->getParam('project_type'); $datas['project_type'] = $this->_request->getParam('project_type');
$datas['project_title'] = $this->_request->getParam('project_title'); $datas['project_title'] = $this->_request->getParam('project_title');
$datas['project_leader']= $this->_request->getParam('project_leader');
$this->view->info = $datas; $this->view->info = $datas;
@ -1252,7 +1253,8 @@ class DataController extends Zend_Controller_Action
'email' =>$datas['email'], 'email' =>$datas['email'],
'project_id'=>$datas['project_id'], 'project_id'=>$datas['project_id'],
'project_title'=>$datas['project_title'], 'project_title'=>$datas['project_title'],
'project_type'=>$datas['project_type'] 'project_type'=>$datas['project_type'],
'project_leader'=>$datas['project_leader']
); );
if($this->db->insert('onlineapp',$data)) if($this->db->insert('onlineapp',$data))
@ -1802,7 +1804,7 @@ class DataController extends Zend_Controller_Action
if (empty($ac)) $ac='offline3'; if (empty($ac)) $ac='offline3';
} }
} else { } else {
$sql="select u.*,o.* from users u left join offlineapp o on u.id=o.userid where u.id=? ORDER BY o.id DESC"; $sql="select u.* from users u left join offlineapp o on u.id=o.userid where u.id=? ORDER BY o.id DESC";
$row=$this->db->fetchRow($sql,array($userid)); $row=$this->db->fetchRow($sql,array($userid));
$this->view->formData = $row; $this->view->formData = $row;
} }

View File

@ -306,7 +306,7 @@ class Order
$pdf->template = $this->config->offline->template; $pdf->template = $this->config->offline->template;
$pdf->heihetemplate = $this->config->offline->heihetemplate; $pdf->heihetemplate = $this->config->offline->heihetemplate;
$formData['project'].='['.$formData['project_title'].' | '.$formData['project_type'].' | '.$formData['project_id'].' | ' . $formData['leader'] . ']'; $formData['project'].='['.$formData['project_title'].' | '.$formData['project_type'].' | '.$formData['project_id'].' | ' . $formData['project_leader'] . ']';
$pdf->data = $formData; $pdf->data = $formData;
if (isset($formData['westdclist'])) $pdf->drawWestdc(); if (isset($formData['westdclist'])) $pdf->drawWestdc();

View File

@ -55,6 +55,7 @@ class PdfOperate implements \Order\listener\PdfEvents
if ($row) { if ($row) {
$s = $dbh->update($this->tbl_offlineapp,$formData," id={$row['id']} "); $s = $dbh->update($this->tbl_offlineapp,$formData," id={$row['id']} ");
$this->updateToUserTable($formData,$row['id']);
if(empty($returnid)) if(empty($returnid))
{ {
return $s; return $s;
@ -62,17 +63,17 @@ class PdfOperate implements \Order\listener\PdfEvents
return $row['id']; return $row['id'];
} }
} else { } else {
$id = $dbh->insert($this->tbl_offlineapp,$formData,true);
$this->updateToUserTable($formData,$id);
if(empty($returnid)) if(empty($returnid))
{ {
$s = $dbh->insert($this->tbl_offlineapp,$formData); if($id > 0)
if($s > 0)
{ {
return true; return true;
}else{ }else{
return "保存失败,请重试"; return "保存失败,请重试";
} }
}else{ }else{
$id = $dbh->insert($this->tbl_offlineapp,$formData,true);
return $id; return $id;
} }
} }
@ -85,6 +86,25 @@ class PdfOperate implements \Order\listener\PdfEvents
return true; return true;
} }
//将项目信息更新到用户表
public function updateToUserTable($formData,$id)
{
$data = array(
'address' => $formData['address'],
'phone' => $formData['phone'],
'postcode' => $formData['postcode'],
'unit' => $formData['unit'],
'project_id' => $formData['project_id'],
'project_type' => $formData['project_type'],
'project_title' => $formData['project_title'],
'project_leader' => $formData['project_leader'],
'project' => $formData['project']
);
$dbh = new dbh($this->db);
@$dbh->update('users',$data," id=$id ");
}
//申请成功提交之后 //申请成功提交之后
public function orderSubmited(\Zend_EventManager_Event $e) public function orderSubmited(\Zend_EventManager_Event $e)
{ {