FastController.class.php
1.63 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
<?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 FastController extends AbstractController
{
/**
* 未认证企业号在分享时,无法自定义Url,只能分享当前Url,也就是快速邀请页
* 因此本接口不能设置为必须登陆
* 当外部人员访问快速邀请页调用本接口时,返回_ERR_OUTUSER_ACCESS_DENIED
* 前端根据此错误,跳转至邀请函页面
*/
protected $_require_login = false;
/**
* 快速邀请
* @author zhonglei
*/
public function Index_post()
{
$link_id = (int)I('post.link_id');
if (empty($this->_login->user)) {
E('_ERR_OUTUSER_ACCESS_DENIED');
}
$user = $this->_login->user;
$settingServ = new InviteSettingService();
$setting = $settingServ->get_by_conds([]);
// 检查管理权限
$this->checkCurrentInvitePower($user);
$ep = Cache::instance()->get(
'Common.EnterpriseDetail',
'',
['expire' => cfg('ENTERPRISE_DETAIL_CACHE_EXPIRE')]
);
$this->_result = [
'username' => $user['memUsername'],
'qy_logo' => $ep['corpSquareLogo'],
'qy_name' => $ep['epName'],
'content' => $setting['content'],
'share_content' => $setting['share_content'],
'qrcode' => oaUrl('Frontend/Index/InviteQrcode/Index', ['link_id' => $link_id]),
'qrcode_expire' => $setting['qrcode_expire'],
];
}
}