SignListController.class.php
1.09 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
<?php
/**
* Created by PhpStorm.
* User: zhonglei
* Date: 2018/5/18
* Time: 16:25
*/
namespace Apicp\Controller\Course;
use Common\Service\SignService;
use Common\Service\CourseArticleService;
class SignListController extends \Apicp\Controller\AbstractController
{
/**
* SignList
* @author zhonglei
* @desc 线下课程签到列表接口
*/
public function Index_post()
{
$params = I('post.');
if (empty($params['article_id'])) {
E('_ERR_ARTICLE_ID_NOT_FOUND');
}
$page = !empty($params['page']) ? intval($params['page']) : self::PAGE_DEFAULT;
$limit = !empty($params['limit']) ? intval($params['limit']) : self::PAGE_LIMIT_DEFAULT;
list($start, $limit) = page_limit($page, $limit);
$page_option = [$start, $limit];
$signServ = new SignService();
$this->_result = $signServ->sign_search_list($params, $page_option);
$articleServ = new CourseArticleService();
$this->_result['qrcode_url'] = $articleServ->getSignQrcodeUrl($params['article_id']);
return true;
}
}