Info.php 796 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Feature\Lib;
  3. use Dever;
  4. class Info
  5. {
  6. # 根据文章id 获取文章信息
  7. public function get($data, $uid = false)
  8. {
  9. if (!is_array($data)) {
  10. $data = Dever::db('feature/info')->getOne($data);
  11. }
  12. if (!$data) {
  13. Dever::alert('错误的专题信息');
  14. }
  15. $data = Dever::load('content/lib/article')->getContent($data, $uid);
  16. return $data;
  17. }
  18. # 获取相关推荐
  19. public function getRelation($info)
  20. {
  21. $where['noid'] = $info['id'];
  22. $where['cate_id'] = $info['cate_id'];
  23. return Dever::db('feature/info')->getRelation($where);
  24. }
  25. # 增加浏览量
  26. public function addView($id)
  27. {
  28. Dever::db('feature/info')->addView($id);
  29. }
  30. }