LiveDetailsController.class.php
1.32 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
/*
* 直播-详情
* 2018.07.19
*
*/
namespace Api\Controller\VhLiveTotal;
use Common\Common\Constant;
use Common\Common\Department;
use Common\Common\Job;
use Common\Common\Role;
use Common\Common\Tag;
use Common\Common\User;
use Common\Common\Vhall;
use Common\Service\VhallService;
class LiveDetailsController extends AbstractController
{
public function Index_post()
{
$liveId = I('post.liveId');
if (empty($liveId)) {
E('_EMPTY_LIVE_ID');
}
// 获取直播详情
$uc_info = Vhall::instance()->details($liveId);
$vhall_service = new VhallService();
// 获取配置详情
$setting_info = $vhall_service->get_by_conds(['vh_id' => $liveId]);
// 如果是内部讲师
if (Constant::INSIDE_TEACHER_TYPE == $setting_info['teacher_type']) {
if ($this->uid != $setting_info['teacher_id']) {
E('_ERR_LIVE_INFO_AUTH');
}
$user_info = User::instance()->getByUid($setting_info['teacher_id']);
$setting_info['teacher_name'] = $user_info['memUsername'];
$setting_info['teacher_face'] = $user_info['memFace'];
}
// 组装数据
$uc_info = array_merge($uc_info, $setting_info);
$this->_result = $uc_info;
return true;
}
}