ArticleDao.php 739 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. class ArticleDao {
  3. public $aid;
  4. public $title;
  5. public $content;
  6. public $time;
  7. public $_table = t_article;
  8. public $_primarykey = "aid";
  9. public $_fields = array ('aid', 'title', 'content', 'time' );
  10. /**
  11. * 删除公告
  12. * @param unknown_type $id
  13. */
  14. function delete_article($id) {
  15. $id = implode ( ",", $id );
  16. $sql = "delete from " . t_article . " where aid in ( " . $id . " )";
  17. Doo::db ()->query ( $sql );
  18. }
  19. /**
  20. * 获取其他公告
  21. * @param unknown_type $id
  22. */
  23. function get_article_other($id = 0) {
  24. $sql = "select * from " . t_article . " where aid!=" . $id." limit 8";
  25. $query = Doo::db ()->query ( $sql );
  26. $result = $query->fetchAll ();
  27. return $result;
  28. }
  29. }
  30. ?>