From b0cb441d47fc15afc86e123fabfc69fb68be68ec Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Fri, 6 Sep 2013 07:05:33 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86project=5Fleader?= =?UTF-8?q?=E5=9C=A8pdf=E4=B8=AD=E8=AF=BB=E5=8F=96=E7=9A=84bug=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=8F=90=E4=BA=A4=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=90=8E=E6=9B=B4=E6=96=B0=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=88=B0=E7=94=A8=E6=88=B7=E8=A1=A8=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/DataController.php | 6 +++-- application/module/Order/Order.php | 2 +- application/module/Order/mount/PdfOperate.php | 26 ++++++++++++++++--- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index cab3d1b9..c9c8bea1 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -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; } diff --git a/application/module/Order/Order.php b/application/module/Order/Order.php index c60a23fb..41689527 100644 --- a/application/module/Order/Order.php +++ b/application/module/Order/Order.php @@ -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(); diff --git a/application/module/Order/mount/PdfOperate.php b/application/module/Order/mount/PdfOperate.php index 7639142d..5f79f4d3 100644 --- a/application/module/Order/mount/PdfOperate.php +++ b/application/module/Order/mount/PdfOperate.php @@ -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) {