Article.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. namespace We7\Table\Site;
  7. class Article extends \We7Table {
  8. protected $tableName = 'site_article';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'uniacid',
  12. 'rid',
  13. 'iscommend',
  14. 'ishot',
  15. 'pcate',
  16. 'ccate',
  17. 'template',
  18. 'title',
  19. 'description',
  20. 'content',
  21. 'thumb',
  22. 'incontent',
  23. 'source',
  24. 'author',
  25. 'displayorder',
  26. 'linkurl',
  27. 'createtime',
  28. 'edittime',
  29. 'click',
  30. 'type',
  31. 'credit'
  32. );
  33. protected $default = array(
  34. 'uniacid' => '',
  35. 'rid' => '',
  36. 'iscommend' => 0,
  37. 'ishot' => 0,
  38. 'pcate' => 0,
  39. 'ccate' => 0,
  40. 'template' => '',
  41. 'title' => '',
  42. 'description' => '',
  43. 'content' => '',
  44. 'thumb' => '',
  45. 'incontent' => 0,
  46. 'source' => '',
  47. 'author' => '',
  48. 'displayorder' => 0,
  49. 'linkurl' => '',
  50. 'createtime' => 0,
  51. 'edittime' => '',
  52. 'click' => 0,
  53. 'type' => '',
  54. 'credit' => ''
  55. );
  56. public function getAllByUniacid($uniacid) {
  57. return $this->query->where('uniacid', $uniacid)->getall();
  58. }
  59. public function getBySnake($fields = '*', $where = array(), $order = array('id' => 'DESC')) {
  60. return $this->query->select($fields)->where($where)->orderby($order);
  61. }
  62. }