public function getData($id)
 {
     $contentHandler = new ContentHandlerModel();
     $res = $this->where(array('news_id' => $id))->find();
     $res['content'] = $contentHandler->displayHtmlContent($res['content']);
     return $res;
 }
예제 #2
0
 public function getList($map, $field = '*', $limit = 0, $order = 'create_time desc')
 {
     if ($limit) {
         $list = $this->where($map)->field($field)->order($order)->limit($limit)->select();
     } else {
         $list = $this->where($map)->field($field)->select();
     }
     $contentHandler = new ContentHandlerModel();
     foreach ($list as &$val) {
         $val['description'] = $contentHandler->displayHtmlContent($val['description']);
     }
     return $list;
 }
예제 #3
0
 public function getSimpleListPage($map, $page = 1, $order = 'create_time desc', $r = 20, $field = '*')
 {
     $totalCount = $this->where($map)->count();
     if ($totalCount) {
         $list = $this->where($map)->page($page, $r)->order($order)->field($field)->select();
         $contentHandler = new ContentHandlerModel();
         foreach ($list as &$val) {
             $val['content'] = $contentHandler->displayHtmlContent($val['content']);
         }
     }
     return array($list, $totalCount);
 }