InfoController.class.php
1.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
<?php
/**
* Created by PhpStorm.
* User: liyifei2012it
* Date: 16/9/17
* Time: 23:02
*/
namespace Apicp\Controller\Department;
use VcySDK\Service;
use VcySDK\Department;
class InfoController extends AbstractController
{
/**
* 【通讯录】部门详情
* @author liyifei
* @time 2016-09-17 22:38:54
*/
public function Index_post()
{
// 接收参数
$dpId = I('post.department_id', '', 'trim');
if (empty($dpId)) {
E('_ERR_DEPARTMENT_ID_IS_NULL');
return false;
}
// 调用架构接口,查询部门详情
$department = new Department(Service::instance());
$data = $department->detail(['dpId' => $dpId]);
$this->_result = [
"name" => $data['dpName'],
"route" => $data['departmentPath'],
"department_total" => $data['childrensDepartmentCount'],
"user_total" => $data['departmentMemberCount'],
];
}
/**
* 模拟数据接口:【通讯录】部门详情
* @author liyifei
* @time 2016-09-17 22:38:54
*/
public function Test_get()
{
$this->_result = [
"name" => "产品部",
"route" => "卡松实验室-产品部",
"department_total" => 12,
"user_total" => 16
];
}
}