1
|
<?php
|
1
|
<?php
|
2
|
|
2
|
|
3
|
use Action\AbstractAction;
|
3
|
use Action\AbstractAction;
|
|
|
4
|
+use Guang\IndexModel;
|
4
|
use LibModels\Wap\Guang\ListData;
|
5
|
use LibModels\Wap\Guang\ListData;
|
5
|
use Plugin\Helpers;
|
6
|
use Plugin\Helpers;
|
6
|
use Plugin\Cache;
|
7
|
use Plugin\Cache;
|
|
@@ -42,7 +43,7 @@ class IndexController extends AbstractAction |
|
@@ -42,7 +43,7 @@ class IndexController extends AbstractAction |
42
|
// $this->setNavSide();
|
43
|
// $this->setNavSide();
|
43
|
// }
|
44
|
// }
|
44
|
|
45
|
|
45
|
- $this->_view->display('index', Guang\IndexModel::getArticle($gender, $type, $uid, $udid));
|
46
|
+ $this->_view->display('index', IndexModel::getArticle($gender, $type, $uid, $udid));
|
46
|
}
|
47
|
}
|
47
|
|
48
|
|
48
|
/**
|
49
|
/**
|
|
@@ -91,7 +92,7 @@ class IndexController extends AbstractAction |
|
@@ -91,7 +92,7 @@ class IndexController extends AbstractAction |
91
|
|
92
|
|
92
|
// 标签聚合内容列表
|
93
|
// 标签聚合内容列表
|
93
|
//$article = ListData::article($gender, 0, $uid, $udid, 1, $tag);
|
94
|
//$article = ListData::article($gender, 0, $uid, $udid, 1, $tag);
|
94
|
- $article = Guang\IndexModel::getArticleByTagOrEditor($gender, 0, $uid, $udid, 1, $tag);
|
95
|
+ $article = IndexModel::getArticleByTagOrEditor($gender, 0, $uid, $udid, 1, $tag);
|
95
|
// 标签聚合内容不存在, 跳到错误页面
|
96
|
// 标签聚合内容不存在, 跳到错误页面
|
96
|
if (empty($article['data']['list']['artList'])) {
|
97
|
if (empty($article['data']['list']['artList'])) {
|
97
|
$this->error();
|
98
|
$this->error();
|
|
@@ -184,7 +185,7 @@ class IndexController extends AbstractAction |
|
@@ -184,7 +185,7 @@ class IndexController extends AbstractAction |
184
|
|
185
|
|
185
|
// 标签聚合内容列表
|
186
|
// 标签聚合内容列表
|
186
|
//$article = ListData::article($gender, 0, $uid, $udid, 1, null, $id);
|
187
|
//$article = ListData::article($gender, 0, $uid, $udid, 1, null, $id);
|
187
|
- $article = Guang\IndexModel::getArticleByTagOrEditor($gender, 0, $uid, $udid, 1, null, $id);
|
188
|
+ $article = IndexModel::getArticleByTagOrEditor($gender, 0, $uid, $udid, 1, null, $id);
|
188
|
// 构建资讯文章内容
|
189
|
// 构建资讯文章内容
|
189
|
if (!empty($article['data']['list']['artList'])) {
|
190
|
if (!empty($article['data']['list']['artList'])) {
|
190
|
$build = array();
|
191
|
$build = array();
|
|
@@ -227,6 +228,7 @@ class IndexController extends AbstractAction |
|
@@ -227,6 +228,7 @@ class IndexController extends AbstractAction |
227
|
$gender = $this->get('gender');
|
228
|
$gender = $this->get('gender');
|
228
|
$authorId = $this->get('authorId');
|
229
|
$authorId = $this->get('authorId');
|
229
|
$isApp = $this->get('isApp', false);
|
230
|
$isApp = $this->get('isApp', false);
|
|
|
231
|
+ $isTab = $this->get('isTab', false); // 是否为tab切换操作
|
230
|
$showAuthor = true;
|
232
|
$showAuthor = true;
|
231
|
if (!empty($sortId) && !is_numeric($sortId)) {
|
233
|
if (!empty($sortId) && !is_numeric($sortId)) {
|
232
|
break;
|
234
|
break;
|
|
@@ -247,18 +249,7 @@ class IndexController extends AbstractAction |
|
@@ -247,18 +249,7 @@ class IndexController extends AbstractAction |
247
|
$udid = $this->getUdid();
|
249
|
$udid = $this->getUdid();
|
248
|
}
|
250
|
}
|
249
|
//$page = intval($page) + 1;
|
251
|
//$page = intval($page) + 1;
|
250
|
- $article = ListData::article($gender, $sortId, $uid, $udid, $page, $tag, $authorId);
|
|
|
251
|
- if (empty($article['data']['list']['artList'])) {
|
|
|
252
|
- break;
|
|
|
253
|
- }
|
|
|
254
|
-
|
|
|
255
|
- /* 构建资讯文章内容 */
|
|
|
256
|
- $data = array();
|
|
|
257
|
- $build = array();
|
|
|
258
|
- foreach ($article['data']['list']['artList'] as $article) {
|
|
|
259
|
- $build[] = Helpers::formatArticle($article, true, $isApp, $showAuthor, $uid);
|
|
|
260
|
- }
|
|
|
261
|
- $data['infos'] = $build;
|
252
|
+ $data = IndexModel::getPageData($gender, $sortId, $uid, $udid, $page, $tag, $authorId, $isApp, $showAuthor, $isTab);
|
262
|
} while (false);
|
253
|
} while (false);
|
263
|
|
254
|
|
264
|
if (isset($data)) {
|
255
|
if (isset($data)) {
|