ListController.class.php
1.17 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
<?php
/**
* 【后台】考勤列表接口
* ListController.class.php
* User: caijianhua
* Date: 2017/8/29
* Time: 下午5:15
*/
namespace Apicp\Controller\Sign;
use Common\Service\SignService;
class ListController extends \Apicp\Controller\AbstractController
{
/** @var SignService 考勤签到表 */
protected $sign_service;
public function before_action($action = '')
{
if (!parent::before_action($action)) {
return false;
}
$this->sign_service = new SignService();
return true;
}
/**
* 考勤列表接口
*
* @author 蔡建华
*/
public function Index_post()
{
$params = I('post.');
$params['article_id'] = 0;
// 分页默认值
$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];
// 考勤列表
$this->_result = $this->sign_service->sign_search_list($params, $page_option);
return true;
}
}