2012-09-04 07:16:19 +00:00
|
|
|
<?php
|
|
|
|
class news
|
|
|
|
{
|
|
|
|
var $db; //传入PDO对象
|
|
|
|
|
|
|
|
function __construct($db)
|
|
|
|
{
|
|
|
|
$this->db = $db;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
递归获得所有栏目
|
|
|
|
*/
|
|
|
|
function getAllCategory($hide = 0){
|
|
|
|
|
|
|
|
$sql = "SELECT c.* FROM news_category c
|
2012-11-09 09:58:33 +00:00
|
|
|
WHERE display>$hide
|
2012-09-04 07:16:19 +00:00
|
|
|
ORDER BY displayorder asc";
|
|
|
|
$re = $this->db->query($sql);
|
|
|
|
$categorys = $re->fetchAll();
|
|
|
|
|
|
|
|
return $categorys;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|