SourceListController.class.php
1.1 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
<?php
/**
* 【后台】获取素材列表接口
* SourceListController.class.php
* User: daijun
* Date: 2017/8/31
*/
namespace Apicp\Controller\Education;
class SourceListController extends \Apicp\Controller\AbstractController
{
public function Index_post()
{
$params = I('post.');
// 默认值
$page = !empty($params['page']) ? intval($params['page']) : self::PAGE_DEFAULT;
$limit = !empty($params['limit']) ? intval($params['limit']) : self::PAGE_LIMIT_DEFAULT;
$keyword = empty($params['search_key']) ? '' : trim($params['search_key']);
$class_id = empty($params['class_id']) ? 0 : intval($params['class_id']);
// 请求地址
$url = rpcUrl('/Course/Rpc/Train/List');
// 请求参数
$data_send = [
'page' => $page,
'limit' => $limit,
'keyword' => $keyword,
'class_id' => $class_id
];
// 发送请求,获取结果
$res_data = \Com\Rpc::phprpc($url)->invoke('Index', $data_send);
$this->_result = $res_data;
return true;
}
}