From 43ec7f74ac64f997c9f174497728c22b8da856af Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 30 Nov 2012 18:20:52 +0000 Subject: [PATCH] fix getArchive method error --- application/models/Archive.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Archive.php b/application/models/Archive.php index bcd732df..b4958a83 100644 --- a/application/models/Archive.php +++ b/application/models/Archive.php @@ -223,8 +223,8 @@ class Archive function getArchive($code='') { - $sql="select * from ".$this->tbl_archives; - if (!empty($code)) $sql.=" where code='".$code."'"; + $sql="select a.* from ".$this->tbl_archives." a left join ".$this->tbl_catalog." ac on a.id=ac.aid left join ".$this->tbl_categorys." c on ac.cid=c.id "; + if (!empty($code)) $sql.=" where c.code='".$code."'"; $rs=$this->db->query($sql); $rows=$rs->fetchAll(); }