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) {