NoticeFollowController.class.php
1.66 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
64
65
<?php
/**
* Created by PhpStorm.
* User: tony
* Date: 2016-11-17
* Time: 11:16:40
*/
namespace Api\Controller\User;
use Common\Common\Cache;
use Common\Common\User;
use Common\Service\NoticeService;
use VcySDK\Adminer;
use VcySDK\Service;
use VcySDK\Enterprise;
class NoticeFollowController extends AbstractController
{
protected $_require_login = false;
/**
* 提醒关注页面
* @author tony
*/
public function Index_post()
{
$notice_id = I('post.notice_id', 0, 'intval');
if (empty($notice_id)) {
E('_ERR_PARAM_IS_NULL');
}
// 需要的数据是企业名称,关注二维码,以及邀请人的电话
$noticeServ = new NoticeService();
$detail = $noticeServ->get($notice_id);
if (empty($detail)) {
E('_ERR_INVITE_DATA_IS_NULL');
}
// 获取用户的性别
$userServ = new User();
$gender = ['', '先生', '女士'];
$userInfo = $userServ->getByUid($detail['uid']);
// 获取企业信息
$ep = Cache::instance()->get(
'Common.EnterpriseDetail',
'',
['expire' => cfg('ENTERPRISE_DETAIL_CACHE_EXPIRE')]
);
// 获取管理员数据
$eaSdk = new Adminer(Service::instance());
$adminer = $eaSdk->fetch(['eaId' => $detail['eaid']]);
$reuslt = [
'adminer_name' => $adminer['eaRealname'],
'user_name' => $detail['user_name'],
'gender' => $gender[$userInfo['memGender']],
'qy_name' => $ep['epName'],
'qy_qrcode' => $ep['corpWxqrcode'],
];
$this->_result = $reuslt;
}
}