ListController.class.php
1013 Bytes
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
<?php
/**
* Created by PhpStorm.
* User: zhonglei
* Date: 2018/3/26
* Time: 11:41
*/
namespace Apicp\Controller\Dict;
use Common\Service\DictService;
class ListController extends AbstractController
{
/**
* List
* @author zhonglei
* @desc 字典列表
* @param String key 字典Key
* @return array
* array(
* 'list' => array( // 字典列表
* 'dict_id' => 1, // 字典ID
* 'key' => 'course_teacher_title', // 字典Key(teacher_title=讲师头衔;teacher_task_type=讲师授课任务类型)
* 'value' => '金牌讲师', // 字典值
* )
* )
*/
public function Index_post()
{
$key = I('post.key');
if (empty($key)) {
E('_ERR_DICT_KEY_EMPTY');
}
$dictServ = new DictService();
$list = $dictServ->list_by_conds(['key' => $key]);
$this->_result['list'] = $list;
}
}