InfoController.class.php
897 Bytes
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
<?php
/**
* InfoController.class.php
* 回帖详情
* User: heyuelong
* Date:2017年4月26日18:07:37
*/
namespace Api\Controller\Replies;
use Common\Common\Constant;
use Common\Service\CircleService;
class InfoController extends \Api\Controller\AbstractController
{
protected $_require_login = false;
public function Index_get()
{
// 回帖id
$id = I('get.id');
if (empty($id)) {
E('_EMPTY_REPLIES_ID');
}
// 回帖详情
$service = new CircleService();
$info = $service->get_by_conds(
[
'id' => $id,
'type' => Constant::CIRCLE_REPLIES_TOPIC_TYPE
]
);
// 回帖详情不存在
if (empty($info)) {
E('_EMPTY_REPLIES_INFO');
}
$this->_result = $service->format_info($info, $this->uid);
}
}