DetailController.class.php
1.3 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
<?php
/**
* Created by PhpStorm.
* User: liyifei2012it
* Date: 16/9/18
* Time: 11:52
*/
namespace Api\Controller\Invite;
use Common\Common\Cache;
use Common\Service\InviteSettingService;
class DetailController extends CheckUserController
{
/**
* 邀请函详情
* @author zhonglei
*/
public function Index_post()
{
$ep = Cache::instance()->get(
'Common.EnterpriseDetail',
'',
['expire' => cfg('ENTERPRISE_DETAIL_CACHE_EXPIRE')]
);
$link_id = I('post.link_id', '', 'trim');
// 如果已经接受了邀请
$user = array();
if ($this->_hasAcceptAndWrite($user, $link_id)) {
$this->_result = array(
'inviteUser' => $user,
'qy_qrcode' => $ep['corpWxqrcode']
);
return true;
}
$user = $this->_checkLinkId($link_id);
$settingService = new InviteSettingService();
$setting = $settingService->getSetting();
$this->_result = [
'qy_logo' => $ep['corpSquareLogo'],
'qy_name' => $ep['epName'],
'content' => $setting['content'],
'qy_qrcode' => $ep['corpWxqrcode'],
'invite_people_name' => $user['memUsername']
];
return true;
}
}