From bd7392f5d128d77ef01128d13fc094539f5afc4b Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 13 Oct 2011 09:09:42 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E5=87=8F=E5=B0=91=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E6=9F=A5=E8=AF=A2=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/models/EmailText.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/application/models/EmailText.php b/application/models/EmailText.php index 6dc5fdbc..da3bcf18 100644 --- a/application/models/EmailText.php +++ b/application/models/EmailText.php @@ -4,6 +4,7 @@ class EmailText{ var $tmpid; var $db; var $data; + var $tmpinfo; function __construct() { @@ -13,19 +14,30 @@ class EmailText{ } } + public function getinfo(){ + + if(is_numeric($this->tmpid)) + $sql = "select * from emailtext where id='".$this->tmpid."'"; + else + $sql = "select * from emailtext where template='".$this->tmpid."'"; + + $rs = $this->db->query($sql); + + $this->tmpinfo = $rs->fetch(); + + } + public function loadtmp(){ if(empty($this->tmpid)) { return false; }else{ - if(is_numeric($this->tmpid)) - $sql = "select id,body from emailtext where id='".$this->tmpid."'"; - else - $sql = "select id,body from emailtext where template='".$this->tmpid."'"; - $rs = $this->db->query($sql); - $c = $rs->fetch(); + $this->getinfo(); + + $c = $this->tmpinfo; + if(!empty($c['id'])) { if(count($this->data)==0)