|
@@ -31,6 +31,14 @@ class News extends Base
|
|
|
* @apiSuccess {Object[]} cate 主栏目信息
|
|
|
* @apiSuccess {Number} cate.id 栏目id
|
|
|
* @apiSuccess {String} cate.name 栏目名称
|
|
|
+
|
|
|
+ * @apiSuccess {Object[]} focus 头部焦点图信息
|
|
|
+ * @apiSuccess {Number} focus.id 焦点图id
|
|
|
+ * @apiSuccess {String} focus.name 焦点图名称
|
|
|
+ * @apiSuccess {String} focus.subname 焦点图子标题
|
|
|
+ * @apiSuccess {String} focus.pic 焦点图图片
|
|
|
+ * @apiSuccess {Number} focus.cate_id 栏目id
|
|
|
+ * @apiSuccess {Number} focus.news_id 资讯id
|
|
|
*
|
|
|
* @apiSuccess {Object[]} cate_child 子栏目信息
|
|
|
* @apiSuccess {Number} cate_child.id 栏目id
|
|
@@ -61,6 +69,9 @@ class News extends Base
|
|
|
$this->data['cate'] = Dever::load('set/cate-one', $this->data['info']['cate_id']);
|
|
|
|
|
|
if ($this->data['cate']) {
|
|
|
+
|
|
|
+ $this->focus($this->data['cate']['id']);
|
|
|
+
|
|
|
$this->data['cate_child'] = Dever::load('set/cate-getAll', array('option_cate_id' => $this->data['cate']['id']));
|
|
|
|
|
|
if ($this->data['cate_child'] && isset($this->data['cate_child'][0])) {
|
|
@@ -77,6 +88,17 @@ class News extends Base
|
|
|
return $this->data;
|
|
|
}
|
|
|
|
|
|
+ private function focus($cate)
|
|
|
+ {
|
|
|
+ $this->data['focus'] = Dever::load('content/focus-getAll', array('option_cate_id_parent' => $cate));
|
|
|
+
|
|
|
+ if ($this->data['focus']) {
|
|
|
+ foreach ($this->data['focus'] as $k => $v) {
|
|
|
+ $this->data['focus'][$k]['pic'] = $this->replacePic($v['pic']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* @api {get} v1/news.list 资讯列表
|
|
|
* @apiVersion 1.0.0
|
|
@@ -99,6 +121,7 @@ class News extends Base
|
|
|
* @apiSuccess {Object[]} news 资讯信息
|
|
|
* @apiSuccess {Number} news.id 资讯id
|
|
|
* @apiSuccess {String} news.name 资讯标题
|
|
|
+ * @apiSuccess {String} news.name 资讯子标题
|
|
|
* @apiSuccess {String} news.content 资讯内容
|
|
|
* @apiSuccess {String} news.num_view 阅读数
|
|
|
* @apiSuccess {String} news.cdate 时间
|
|
@@ -122,10 +145,10 @@ class News extends Base
|
|
|
$cate = Dever::load('set/cate-one', $cateid);
|
|
|
|
|
|
if ($cate) {
|
|
|
- $news = Dever::load('content/news-getAll', array('option_info_id' => $this->data['info']['id'], 'option_cate_id' => $cate['id']));
|
|
|
+ $this->data['news'] = Dever::load('content/news-getAll', array('option_info_id' => $this->data['info']['id'], 'option_cate_id' => $cate['id']));
|
|
|
|
|
|
- if ($news) {
|
|
|
- foreach ($news as $k => $v) {
|
|
|
+ if ($this->data['news']) {
|
|
|
+ foreach ($this->data['news'] as $k => $v) {
|
|
|
$this->data['news'][$k] = $this->one($v);
|
|
|
}
|
|
|
}
|