StarClass.php
2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?php
use Action\AbstractAction;
use Guang\StarClassModel;
use LibModels\Wap\Guang\StarClassData;
/**
* 星潮教室
*/
class StarClassController extends AbstractAction
{
/**
* 星潮教室首页
*/
public function indexAction()
{
//判断登录
// $this->auditJumpLogin();
$uid = $this->getUid();
$data = StarClassModel::getStarClass($uid);
//print_r($data);
$this->_view->display('index', array(
'trendClassHome' => $data,
'trendClassHomePage' => true
)
);
}
//星潮教室-星专题
public function specialAction()
{
$data = StarClassModel::getspecial();
//print_r($data);
$this->_view->display('subject', array(
'trendClassSubject' => $data
));
}
//星潮教室-星搭配
public function collocationAction()
{
$data = StarClassModel::getCollocation();
$this->_view->display('collocation-list', array(
'trendClassCollocationPage' => true,
'trendClassCollocation' => $data
));
}
//星潮教室-星搭配文章请求
public function ajaxCollocationAction()
{
if (!$this->isAjax()) {
return;
}
$page = $this->get('page',2);
$data = StarClassModel::ajaxCollocation($page);
if (isset($data) && !empty($data)) {
$this->_view->display('collocation-list', array(
'trendClassCollocation' => $data
));
}else{
echo ' ';
}
}
//签到
public function signAction()
{
// if(!$this->isAjax()){
// return;
// }
$uid = $this->getUid();
//echo $uid;
$res = StarClassModel::sign($uid);
$this->echoJson($res);
}
//点赞
public function setPraiseAction()
{
// if(!$this->isAjax()){
// return;
// }
$udid = $this->getUdid();
$articleId = $this->post('articleId');
$result = StarClassData::setPraise($articleId, $udid);
$this->echoJson($result);
}
//转发
public function forwardAction()
{
// if(!$this->isAjax()){
// return;
// }
//未登录跳转登录页
$this->auditJumpLogin();
$uid = $this->getUid();
}
}