Commit e1e47db7 authored by zhuwei's avatar zhuwei

商学院评论列表

parent 2e54b526
...@@ -279,7 +279,9 @@ class News extends Basic ...@@ -279,7 +279,9 @@ class News extends Basic
$m_comment = new SNewsComment(); $m_comment = new SNewsComment();
$field = 'a.id,a.comment_content,a.create_time,b.name,c.title'; $field = 'a.id,a.comment_content,a.create_time,b.name,c.title';
$data = $m_comment->getCommentList($pageNo, $pageSize, 'a.id DESC', $field, $where); $return = $m_comment->getCommentList($pageNo, $pageSize, 'a.id DESC', $field, $where);
$data['list'] = $return;
$data['total'] = $m_comment->getCommentListTotal($where);
return $this->response(200, "", $data); return $this->response(200, "", $data);
} }
......
...@@ -72,6 +72,16 @@ class SNewsComment extends BaseModel ...@@ -72,6 +72,16 @@ class SNewsComment extends BaseModel
return $data; return $data;
} }
public function getCommentListTotal($params = '')
{
$data = $this
->alias('a')
->join('a_agents b', 'a.agent_id = b.id', 'left')
->join('s_news c', 'a.s_news_id = c.id', 'left')
->where($params)
->count();
return $data;
}
/** /**
* 更新数据 * 更新数据
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment