AccountController.class.php
1.64 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
<?php
/**
* 系统设置-账号信息获取
* 鲜彤 2016年08月01日16:15:17
*
* @update 2016-10-12 zhuxun37 修改企业信息字段以及整理方式
*/
namespace Apicp\Controller\SysSetting;
use Common\Common\Cache;
use VcySDK\Member;
use VcySDK\Service;
class AccountController extends AbstractController
{
public function Index()
{
// 调用UC接口,获取账号信息
$detail = Cache::instance()->get(
'Common.EnterpriseDetail',
'',
['expire' => cfg('ENTERPRISE_DETAIL_CACHE_EXPIRE')]
);
// 组建返回信息
$this->_result = array(
'epName' => $detail['epName'],
'epEnumber' => $detail['epEnumber'],
'epCompanysize' => $detail['epCompanysize'],
'epProvince' => $detail['epProvince'],
'epCity' => $detail['epCity'],
'epCounty' => $detail['epCounty'],
'epIndustry' => $detail['epIndustry'],
'epContacter' => $detail['epContacter'],
'epContactmobile' => $detail['epContactmobile'],
'epContactemail' => $detail['epContactemail'],
'epMembercount' => $this->_getMemCount(),
'epCreated' => $detail['epCreated']
);
return true;
}
/**
* 获取用户总数
*
* @return int 返回用户总数
*/
protected function _getMemCount()
{
// 获取用户列表
$memberSDK = new Member(Service::instance());
$memList = $memberSDK->listAll(array(), 1, 1);
// 返回用户总数
return isset($memList['total']) ? intval($memList['total']) : 0;
}
}