From ed5269a182714b22288d17160ee22205744c458e Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 6 Dec 2012 05:48:55 +0000 Subject: [PATCH] =?UTF-8?q?#434,=20=E5=AE=9E=E7=8E=B0=E9=82=AE=E4=BB=B6?= =?UTF-8?q?=E5=8F=91=E9=80=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/default/controllers/DataController.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 47becb96..48536104 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -1110,9 +1110,10 @@ class DataController extends Zend_Controller_Action $userid = $user->id; } - $testsql="select id from onlineapp where userid='$userid' and uuid='$uuid' order by id desc"; + $testsql="select id,has_send_mail from onlineapp where userid='$userid' and uuid='$uuid' order by id desc"; $result=$this->db->query($testsql); - $rows = $result->fetch(); + $rows = $result->fetch(); + $has_send_mail=$rows['has_send_mail']; if (empty($rows['id'])) { $this->_redirect('/data/'.$uuid); @@ -1136,7 +1137,8 @@ class DataController extends Zend_Controller_Action $sql="update dataorder set onlineappid='$onlineappid',ts_approved=now() where id='{$row['id']}'"; try {$this->db->exec($sql);} catch (Exception $e) {} } - } + } + $this->view->username='westdc'.Zend_Auth::getInstance()->getIdentity()->id; $sql=$this->db->quoteInto("select o.* from onlineresource o left join metadata m on o.uuid=m.uuid where m.datatype=0 and m.uuid=?",$uuid); $rows=$this->db->fetchAll($sql); @@ -1247,7 +1249,7 @@ class DataController extends Zend_Controller_Action $sql="insert into dataorder (userid,uuid,ts_created) values(?,?,now())"; $this->db->query($sql,array($userid,$uuid)); }*/ - if (!empty($ftpurls) && ($updateftp || $updateftp1)) + if (!empty($ftpurls) && ($updateftp || $updateftp1) && !$has_send_mail) { $data = array( "uuid"=>$uuid, @@ -1266,6 +1268,9 @@ class DataController extends Zend_Controller_Action $mail->addTo($user->email); $mail->setSubject($mailtp->getSubject()); @$mail->send(); + $sql="update onlineapp set has_send_mail=true where id=?"; + $sth=$this->db->prepare($sql); + $sth->execute(array($onlineappid)); } } /*