12345678910111213141516171819202122232425262728293031323334 |
- <?php namespace Content\Lib;
- use Dever;
- class Data
- {
- # 获取内容信息
- public function get($data, $uid = false)
- {
- if (!is_array($data)) {
- $data = Dever::db('content/news')->getOne($data);
- }
-
- if (!$data) {
- Dever::alert('错误的文章信息');
- }
- return $data;
- }
- # 获取相关推荐
- public function getRelation($info)
- {
- $where['noid'] = $info['id'];
- $where['cate_id'] = $info['cate_id'];
- return Dever::db('content/news')->getRelation($where);
- }
- # 增加浏览量
- public function addView($id)
- {
- Dever::db('content/news')->addView($id);
- }
- }
|