MemberStatusCountController.class.php
1.52 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
<?php
/**
* 员工加入状态统计
*/
namespace Apicp\Controller\User;
use Common\Service\UserService;
use VcySDK\Member;
use VcySDK\Service;
class MemberStatusCountController extends AbstractController
{
public function Index_post()
{
$role = $this->_login->role;
// 接收定义参数
$dpId = I('post.department_id', '', 'trim');
$keyword = I('post.keyword', '', 'trim');
$status = I('post.status', '', 'trim');
$active = I('post.active', '', 'trim');
$mobile = I('post.mobile', '', 'trim');
$email = I('post.email', '', 'trim');
$jobIds = I('post.job_ids', '', 'trim');
$roleIds = I('post.role_ids', '', 'trim');
// UC查询条件
$conds = [
'departmentChildrenFlag' => UserService::DEPT_CHILDREN_FLAG,
'memUsername' => $keyword,
'memSubscribeStatus' => $status,
'memMobile' => $mobile,
'memEmail' => $email,
'memActive' => $active
];
if (!empty($dpId)) {
$conds['dpIdList'] = (array)$dpId;
} elseif (!empty($role['readDpIdList'])) {
$conds['dpIdList'] = $role['readDpIdList'];
}
if (!empty($jobIds)) {
$conds['jobIdList'] = (array)$jobIds;
}
if (!empty($roleIds)) {
$conds['roleIdList'] = (array)$roleIds;
}
$memberSdk = new Member(Service::instance());
$this->_result = $memberSdk->memberStatusCount($conds);
return true;
}
}