修改了project_leader在pdf中读取的bug,添加了提交离线申请后更新信息到用户表的功能
This commit is contained in:
parent
e73480fb38
commit
b0cb441d47
|
@ -1202,6 +1202,7 @@ class DataController extends Zend_Controller_Action
|
|||
$datas['project_id'] = $this->_request->getParam('project_id');
|
||||
$datas['project_type'] = $this->_request->getParam('project_type');
|
||||
$datas['project_title'] = $this->_request->getParam('project_title');
|
||||
$datas['project_leader']= $this->_request->getParam('project_leader');
|
||||
|
||||
$this->view->info = $datas;
|
||||
|
||||
|
@ -1252,7 +1253,8 @@ class DataController extends Zend_Controller_Action
|
|||
'email' =>$datas['email'],
|
||||
'project_id'=>$datas['project_id'],
|
||||
'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))
|
||||
|
@ -1802,7 +1804,7 @@ class DataController extends Zend_Controller_Action
|
|||
if (empty($ac)) $ac='offline3';
|
||||
}
|
||||
} 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));
|
||||
$this->view->formData = $row;
|
||||
}
|
||||
|
|
|
@ -306,7 +306,7 @@ class Order
|
|||
$pdf->template = $this->config->offline->template;
|
||||
|
||||
$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;
|
||||
|
||||
if (isset($formData['westdclist'])) $pdf->drawWestdc();
|
||||
|
|
|
@ -55,6 +55,7 @@ class PdfOperate implements \Order\listener\PdfEvents
|
|||
|
||||
if ($row) {
|
||||
$s = $dbh->update($this->tbl_offlineapp,$formData," id={$row['id']} ");
|
||||
$this->updateToUserTable($formData,$row['id']);
|
||||
if(empty($returnid))
|
||||
{
|
||||
return $s;
|
||||
|
@ -62,17 +63,17 @@ class PdfOperate implements \Order\listener\PdfEvents
|
|||
return $row['id'];
|
||||
}
|
||||
} else {
|
||||
$id = $dbh->insert($this->tbl_offlineapp,$formData,true);
|
||||
$this->updateToUserTable($formData,$id);
|
||||
if(empty($returnid))
|
||||
{
|
||||
$s = $dbh->insert($this->tbl_offlineapp,$formData);
|
||||
if($s > 0)
|
||||
if($id > 0)
|
||||
{
|
||||
return true;
|
||||
}else{
|
||||
return "保存失败,请重试";
|
||||
}
|
||||
}else{
|
||||
$id = $dbh->insert($this->tbl_offlineapp,$formData,true);
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
|
@ -85,6 +86,25 @@ class PdfOperate implements \Order\listener\PdfEvents
|
|||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue