#434, 实现邮件发送判断
This commit is contained in:
parent
f4251437db
commit
ed5269a182
|
@ -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));
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue