| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- Doo::loadCore ( 'db/DooModel' );
- class ArticleDao extends DooModel{
-
- public $aid;
- public $cid;
- public $title;
- public $content;
- public $time;
- public $displayorder;
- public $_table = 'zhhelp_article';
- public $_primarykey = "aid";
- public $_fields = array ('aid', 'title', 'content', 'time', 'cid','displayorder' );
-
- /**
- * 获取
- * Enter description here ...
- */
- function get_article() {
- $sql = "select * from " . $this->_table;
- $query = Doo::db ()->query ( $sql );
- $result = $query->fetchAll ();
- return $result;
- }
-
- /**
- * 根据id获取文章
- * @param unknown_type $aid
- */
- function get_article_by_aid ( $aid ){
- $sql = "select displayorder,aid, title, content, time, cid from " . $this->_table . " where aid=" . $aid;
- $query = Doo::db ()->query ( $sql );
- $result = $query->fetch ();
- return $result;
- }
-
- /**
- * 根据分类获取文章
- * @param unknown_type $cid
- */
- function get_article_by_cid($cid = 0) {
- $sql = "select displayorder,aid, title, content, cid from " . $this->_table . " where cid=" . $cid;
- $query = Doo::db ()->query ( $sql );
- $result = $query->fetchAll ();
- return $result;
- }
- }
- ?>
|