ClassController.class.php
1.5 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
<?php
/**
* ClassController.class.php
* 收藏类型列表
* @author Deepseath
* @version $Id$
*/
namespace Api\Controller\Collection;
use Common\Service\CommonCollectionService;
class ClassController extends AbstractController
{
protected $_app_list = [
'activity' => '员圈活动',
'course' => '课程中心',
'exam' => '考试中心',
'answer' => '问答中心',
'doc' => '资料库',
'live' => '员圈直播',
'news' => '员圈头条',
'workmate' => '同事圈',
'questionnaire' => '培训调研',
'train' => '企业培训',
'task' => '员圈任务',
'sale' => '业绩比拼',
'teacher' => '企业讲师',
'map' => '学习地图'
];
/**
* 获取收藏分类列表
* @return bool
*/
public function Index()
{
// 排序参数
$order_option = ['c_time' => 'DESC'];
$collectionService = new CommonCollectionService();
// 获取列表
$data = $collectionService->list_by_conds(['uid'=>$this->uid], null, $order_option, 'distinct(app_dir) AS app');
$list=[];
foreach ($data as $value){
$list[]=[
'app'=>$value['app'],
'name'=>$this->_app_list[strtolower($value['app'])]
];
}
// 返回数据
$this->_result = array(
'list' => $list,
);
return true;
}
}